mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Refactoring: created a OutputSettings class to contain all the output settings for writing files. Default the settings are loaded from the configuration, in a later version it will be possible to have separate settings for every destination and these can be configured at one place... the settings form.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1815 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5902a3d236
commit
e5fd88ebd3
21 changed files with 182 additions and 123 deletions
|
@ -104,10 +104,11 @@ namespace GreenshotJiraPlugin {
|
|||
public override bool ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||
string filename = Path.GetFileName(jiraPlugin.Host.GetFilename(config.UploadFormat, captureDetails));
|
||||
byte[] buffer;
|
||||
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
|
||||
if (jira != null) {
|
||||
using (MemoryStream stream = new MemoryStream()) {
|
||||
using (Image image = surface.GetImageForExport()) {
|
||||
jiraPlugin.Host.SaveToStream(image, stream, config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
|
||||
jiraPlugin.Host.SaveToStream(image, stream, outputSettings);
|
||||
}
|
||||
// COPY stream to buffer
|
||||
buffer = stream.ToArray();
|
||||
|
@ -134,7 +135,7 @@ namespace GreenshotJiraPlugin {
|
|||
if (result == DialogResult.OK) {
|
||||
using (MemoryStream stream = new MemoryStream()) {
|
||||
using (Image image = surface.GetImageForExport()) {
|
||||
jiraPlugin.Host.SaveToStream(image, stream, config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
|
||||
jiraPlugin.Host.SaveToStream(image, stream, outputSettings);
|
||||
}
|
||||
// COPY stream to buffer
|
||||
buffer = stream.ToArray();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue