From 448f82f6c37a28b0f8e903246964b5d94d73034d Mon Sep 17 00:00:00 2001 From: RKrom Date: Mon, 8 Oct 2012 15:32:14 +0000 Subject: [PATCH] Code reuse and cleanup. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2126 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/ImageEditorForm.cs | 6 -- GreenshotConfluencePlugin/Confluence.cs | 4 +- .../ConfluenceDestination.cs | 13 ++- GreenshotConfluencePlugin/LanguageKeys.cs | 3 +- .../language_confluenceplugin-de-DE.xml | 3 + .../language_confluenceplugin-en-US.xml | 3 + .../language_confluenceplugin-nl-NL.xml | 3 + GreenshotImgurPlugin/ImgurUtils.cs | 2 +- GreenshotJiraPlugin/Forms/JiraForm.cs | 9 +-- GreenshotJiraPlugin/Jira.cs | 22 +---- GreenshotJiraPlugin/JiraDestination.cs | 54 +++++-------- .../Languages/language_jiraplugin-nl-NL.xml | 4 +- .../PhotobucketUtils.cs | 2 +- GreenshotPlugin/Core/NetworkHelper.cs | 81 +++++++++++++++---- GreenshotPlugin/Core/OAuthHelper.cs | 10 +-- .../Interfaces/Forms/ImageEditor.cs | 7 -- 16 files changed, 119 insertions(+), 107 deletions(-) diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index d0cccc4c5..c9762149d 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -428,12 +428,6 @@ namespace Greenshot { get { return surface.CaptureDetails; } } - public void SaveToStream(Stream stream, OutputSettings outputSettings) { - using (Image image = surface.GetImageForExport()) { - ImageOutput.SaveToStream(image, stream, outputSettings); - } - } - public ToolStripMenuItem GetPluginMenuItem() { return pluginToolStripMenuItem; } diff --git a/GreenshotConfluencePlugin/Confluence.cs b/GreenshotConfluencePlugin/Confluence.cs index b9bb2db12..4dfbc6b54 100644 --- a/GreenshotConfluencePlugin/Confluence.cs +++ b/GreenshotConfluencePlugin/Confluence.cs @@ -208,14 +208,14 @@ namespace Confluence { } } - public void addAttachment(long pageId, string mime, string comment, string filename, byte[] buffer) { + public void addAttachment(long pageId, string mime, string comment, string filename, IBinaryContainer image) { checkCredentials(); RemoteAttachment attachment = new RemoteAttachment(); // Comment is ignored, see: http://jira.atlassian.com/browse/CONF-9395 attachment.comment = comment; attachment.fileName = filename; attachment.contentType = mime; - confluence.addAttachment(credentials, pageId, attachment, buffer); + confluence.addAttachment(credentials, pageId, attachment, image.ToByteArray()); } public Page getPage(string spaceKey, string pageTitle) { diff --git a/GreenshotConfluencePlugin/ConfluenceDestination.cs b/GreenshotConfluencePlugin/ConfluenceDestination.cs index 34f0450c2..ff5200f2d 100644 --- a/GreenshotConfluencePlugin/ConfluenceDestination.cs +++ b/GreenshotConfluencePlugin/ConfluenceDestination.cs @@ -30,6 +30,7 @@ using Confluence; using Greenshot.Plugin; using GreenshotPlugin.Core; using Greenshot.IniFile; +using GreenshotPlugin.Controls; namespace GreenshotConfluencePlugin { /// @@ -158,15 +159,13 @@ namespace GreenshotConfluencePlugin { private bool upload(Image image, Page page, string filename, out string errorMessage) { OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors); - byte[] buffer; - using (MemoryStream stream = new MemoryStream()) { - ImageOutput.SaveToStream(image, stream, outputSettings); - // COPY buffer to array - buffer = stream.ToArray(); - } errorMessage = null; try { - ConfluencePlugin.ConfluenceConnector.addAttachment(page.id, "image/" + config.UploadFormat.ToString().ToLower(), null, filename, buffer); + new PleaseWaitForm().ShowAndWait(Description, Language.GetString("confluence", LangKey.communication_wait), + delegate() { + ConfluencePlugin.ConfluenceConnector.addAttachment(page.id, "image/" + config.UploadFormat.ToString().ToLower(), null, filename, new ImageContainer(image, outputSettings, filename)); + } + ); LOG.Debug("Uploaded to Confluence."); if (config.CopyWikiMarkupForImageToClipboard) { int retryCount = 2; diff --git a/GreenshotConfluencePlugin/LanguageKeys.cs b/GreenshotConfluencePlugin/LanguageKeys.cs index 2d2eb3fa9..9f033ace8 100644 --- a/GreenshotConfluencePlugin/LanguageKeys.cs +++ b/GreenshotConfluencePlugin/LanguageKeys.cs @@ -30,6 +30,7 @@ namespace GreenshotConfluencePlugin { CANCEL, upload_menu_item, upload_success, - upload_failure + upload_failure, + communication_wait } } diff --git a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-de-DE.xml b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-de-DE.xml index f496876d2..3a659e5f0 100644 --- a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-de-DE.xml +++ b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-de-DE.xml @@ -70,5 +70,8 @@ Confluence Daten werden geladen, bitte warten! + + Übermittle Daten zu Confluence. Bitte warten... + \ No newline at end of file diff --git a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-en-US.xml b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-en-US.xml index dfc8f1580..033202226 100644 --- a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-en-US.xml +++ b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-en-US.xml @@ -73,5 +73,8 @@ Include personal spaces in search and browsing + + Transferring data to Confluence, please wait... + \ No newline at end of file diff --git a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-nl-NL.xml b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-nl-NL.xml index bc7d76872..24700e882 100644 --- a/GreenshotConfluencePlugin/Languages/language_confluenceplugin-nl-NL.xml +++ b/GreenshotConfluencePlugin/Languages/language_confluenceplugin-nl-NL.xml @@ -70,5 +70,8 @@ Confluence daten worden geladen, wachten A.U.B. + + Gegevensoverdracht naar Confluence, wachten A.U.B... + \ No newline at end of file diff --git a/GreenshotImgurPlugin/ImgurUtils.cs b/GreenshotImgurPlugin/ImgurUtils.cs index ad6316c79..504aa8b9a 100644 --- a/GreenshotImgurPlugin/ImgurUtils.cs +++ b/GreenshotImgurPlugin/ImgurUtils.cs @@ -168,7 +168,7 @@ namespace GreenshotImgurPlugin { if (filename != null) { uploadParameters.Add("name", filename); } - uploadParameters.Add("image", new ImageParameter(image, outputSettings, filename)); + uploadParameters.Add("image", new ImageContainer(image, outputSettings, filename)); responseString = oAuth.MakeRequest(HTTPMethod.POST, apiUrl, uploadParameters, null, null); } catch (Exception ex) { LOG.Error("Upload to imgur gave an exeption: ", ex); diff --git a/GreenshotJiraPlugin/Forms/JiraForm.cs b/GreenshotJiraPlugin/Forms/JiraForm.cs index 17404e7da..31e249b76 100644 --- a/GreenshotJiraPlugin/Forms/JiraForm.cs +++ b/GreenshotJiraPlugin/Forms/JiraForm.cs @@ -101,14 +101,7 @@ namespace GreenshotJiraPlugin { return selectedIssue; } - public void upload(string text) { - jiraConnector.addAttachment(selectedIssue.Key, jiraFilenameBox.Text, text); - if (jiraCommentBox.Text != null && jiraCommentBox.Text.Length > 0) { - jiraConnector.addComment(selectedIssue.Key, jiraCommentBox.Text); - } - } - - public void upload(byte [] attachment) { + public void upload(IBinaryContainer attachment) { config.LastUsedJira = selectedIssue.Key; jiraConnector.addAttachment(selectedIssue.Key, jiraFilenameBox.Text, attachment); if (jiraCommentBox.Text != null && jiraCommentBox.Text.Length > 0) { diff --git a/GreenshotJiraPlugin/Jira.cs b/GreenshotJiraPlugin/Jira.cs index 94e0e805a..776686d17 100644 --- a/GreenshotJiraPlugin/Jira.cs +++ b/GreenshotJiraPlugin/Jira.cs @@ -292,16 +292,15 @@ namespace Jira { return url.Replace(DEFAULT_POSTFIX,"") + "/browse/" + issueKey; } - public void addAttachment(string issueKey, string filename, byte [] buffer) { + public void addAttachment(string issueKey, string filename, IBinaryContainer attachment) { checkCredentials(); try { - string base64String = Convert.ToBase64String(buffer, Base64FormattingOptions.InsertLineBreaks); - jira.addBase64EncodedAttachmentsToIssue(credentials, issueKey, new string[] { filename }, new string[] { base64String }); + jira.addBase64EncodedAttachmentsToIssue(credentials, issueKey, new string[] { filename }, new string[] { attachment.ToBase64String(Base64FormattingOptions.InsertLineBreaks) }); } catch (Exception ex1) { LOG.WarnFormat("Failed to upload by using method addBase64EncodedAttachmentsToIssue, error was {0}", ex1.Message); try { LOG.Warn("Trying addAttachmentsToIssue instead"); - jira.addAttachmentsToIssue(credentials, issueKey, new string[] { filename }, (sbyte[]) (Array)buffer); + jira.addAttachmentsToIssue(credentials, issueKey, new string[] { filename }, (sbyte[])(Array)attachment.ToByteArray()); } catch (Exception ex2) { LOG.WarnFormat("Failed to use alternative method, error was: {0}", ex2.Message); throw ex2; @@ -309,21 +308,6 @@ namespace Jira { } } - public void addAttachment(string issueKey, string filename, string attachmentText) { - Encoding WINDOWS1252 = Encoding.GetEncoding(1252); - byte[] attachment = WINDOWS1252.GetBytes(attachmentText.ToCharArray()); - addAttachment(issueKey, filename, attachment); - } - - public void addAttachment(string issueKey, string filePath) { - FileInfo fileInfo = new FileInfo(filePath); - byte[] buffer = new byte[fileInfo.Length]; - using (FileStream stream = new FileStream(filePath, FileMode.Open)) { - stream.Read(buffer, 0, (int)fileInfo.Length); - } - addAttachment(issueKey, Path.GetFileName(filePath), buffer); - } - public void addComment(string issueKey, string commentString) { RemoteComment comment = new RemoteComment(); comment.body = commentString; diff --git a/GreenshotJiraPlugin/JiraDestination.cs b/GreenshotJiraPlugin/JiraDestination.cs index a3820bd6a..2633851d5 100644 --- a/GreenshotJiraPlugin/JiraDestination.cs +++ b/GreenshotJiraPlugin/JiraDestination.cs @@ -104,50 +104,38 @@ namespace GreenshotJiraPlugin { public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description); string filename = Path.GetFileName(FilenameHelper.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()) { - ImageOutput.SaveToStream(image, stream, outputSettings); + using (Image image = surface.GetImageForExport()) { + try { + // Run upload in the background + new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait), + delegate() { + jiraPlugin.JiraConnector.addAttachment(jira.Key, filename, new ImageContainer(image, outputSettings, filename)); + } + ); + LOG.Debug("Uploaded to Jira."); + exportInformation.ExportMade = true; + exportInformation.Uri = surface.UploadURL; + } catch (Exception e) { + MessageBox.Show(Language.GetString("jira", LangKey.upload_failure) + " " + e.Message); } - // COPY stream to buffer - buffer = stream.ToArray(); - } - try { - // Run upload in the background - new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait), - delegate() { - jiraPlugin.JiraConnector.addAttachment(jira.Key, filename, buffer); - } - ); - LOG.Debug("Uploaded to Jira."); - exportInformation.ExportMade = true; - exportInformation.Uri = surface.UploadURL; - } catch (Exception e) { - MessageBox.Show(Language.GetString("jira", LangKey.upload_failure) + " " + e.Message); } } else { JiraForm jiraForm = new JiraForm(jiraPlugin.JiraConnector); - if (jiraPlugin.JiraConnector.isLoggedIn) { jiraForm.setFilename(filename); DialogResult result = jiraForm.ShowDialog(); if (result == DialogResult.OK) { - using (MemoryStream stream = new MemoryStream()) { - using (Image image = surface.GetImageForExport()) { - ImageOutput.SaveToStream(image, stream, outputSettings); - } - // COPY stream to buffer - buffer = stream.ToArray(); - } try { - // Run upload in the background - new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait), - delegate() { - jiraForm.upload(buffer); - } - ); + using (Image image = surface.GetImageForExport()) { + // Run upload in the background + new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait), + delegate() { + jiraForm.upload(new ImageContainer(image, outputSettings, filename)); + } + ); + } LOG.Debug("Uploaded to Jira."); exportInformation.ExportMade = true; exportInformation.Uri = surface.UploadURL; diff --git a/GreenshotJiraPlugin/Languages/language_jiraplugin-nl-NL.xml b/GreenshotJiraPlugin/Languages/language_jiraplugin-nl-NL.xml index 54547d469..47275ceae 100644 --- a/GreenshotJiraPlugin/Languages/language_jiraplugin-nl-NL.xml +++ b/GreenshotJiraPlugin/Languages/language_jiraplugin-nl-NL.xml @@ -65,7 +65,7 @@ Beeld formaat - Data overdraging naar Jira, wachten AUB... - + Gegevensoverdracht naar Jira, wachten A.U.B... + \ No newline at end of file diff --git a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs index b2107d600..462f3e921 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs +++ b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs @@ -96,7 +96,7 @@ namespace GreenshotPhotobucketPlugin { oAuth.Sign(HTTPMethod.POST, apiUrl, parameters); apiUrl = apiUrl.Replace("api.photobucket.com", config.SubDomain); // Add image - parameters.Add("uploadfile", new ImageParameter(image, outputSettings, filename)); + parameters.Add("uploadfile", new ImageContainer(image, outputSettings, filename)); responseString = oAuth.MakeRequest(HTTPMethod.POST, apiUrl, parameters, null, null); } catch (Exception ex) { LOG.Error("Error uploading to Photobucket.", ex); diff --git a/GreenshotPlugin/Core/NetworkHelper.cs b/GreenshotPlugin/Core/NetworkHelper.cs index f039d1e2c..3757b3cd2 100644 --- a/GreenshotPlugin/Core/NetworkHelper.cs +++ b/GreenshotPlugin/Core/NetworkHelper.cs @@ -264,8 +264,8 @@ namespace GreenshotPlugin.Core { needsCLRF = true; - if (param.Value is IBinaryParameter) { - IBinaryParameter binaryParameter = (IBinaryParameter)param.Value; + if (param.Value is IBinaryContainer) { + IBinaryContainer binaryParameter = (IBinaryContainer)param.Value; binaryParameter.WriteFormDataToStream(boundary, param.Key, formDataStream); } else { string postData = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"\r\n\r\n{2}", @@ -283,27 +283,31 @@ namespace GreenshotPlugin.Core { } } - public interface IBinaryParameter { + /// + /// This interface can be used to pass binary information around, like byte[] or Image + /// + public interface IBinaryContainer { void WriteFormDataToStream(string boundary, string key, Stream formDataStream); void WriteToStream(Stream formDataStream); - string ToBase64String(); + string ToBase64String(Base64FormattingOptions formattingOptions); + byte[] ToByteArray(); } /// /// A container to supply files to a Multi-part form data upload /// - public class FileParameter : IBinaryParameter { + public class FileContainer : IBinaryContainer { private byte[] file; private string fileName; private string contentType; private int fileSize; - public FileParameter(byte[] file) : this(file, null) { + public FileContainer(byte[] file) : this(file, null) { } - public FileParameter(byte[] file, string filename) : this(file, filename, null) { + public FileContainer(byte[] file, string filename) : this(file, filename, null) { } - public FileParameter(byte[] file, string filename, string contenttype) : this(file, filename, contenttype, 0) { + public FileContainer(byte[] file, string filename, string contenttype) : this(file, filename, contenttype, 0) { } - public FileParameter(byte[] file, string filename, string contenttype, int filesize) { + public FileContainer(byte[] file, string filename, string contenttype, int filesize) { this.file = file; this.fileName = filename; this.contentType = contenttype; @@ -314,10 +318,27 @@ namespace GreenshotPlugin.Core { } } - public string ToBase64String() { - return System.Convert.ToBase64String(file, 0, fileSize); + /// + /// Create a Base64String from the byte[] + /// + /// string + public string ToBase64String(Base64FormattingOptions formattingOptions) { + return System.Convert.ToBase64String(file, 0, fileSize, formattingOptions); } + /// + /// Returns the initial byte-array which was supplied when creating the FileParameter + /// + /// byte[] + public byte[] ToByteArray() { + return file; + } + + /// + /// Write Multipart Form Data directly to the HttpWebRequest response stream + /// + /// HttpWebRequest to write the multipart form data to + /// Parameters to include in the multipart form data public void WriteFormDataToStream(string boundary, string key, Stream formDataStream) { // Add just the first part of this param, since we will write the file data directly to the Stream string header = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"; filename=\"{2}\";\r\nContent-Type: {3}\r\n\r\n", @@ -332,6 +353,10 @@ namespace GreenshotPlugin.Core { formDataStream.Write(file, 0, fileSize); } + /// + /// A plain "write data to stream" + /// + /// public void WriteToStream(Stream dataStream) { // Write the file data directly to the Stream, rather than serializing it to a string. dataStream.Write(file, 0, fileSize); @@ -341,24 +366,46 @@ namespace GreenshotPlugin.Core { /// /// A container to supply images to a Multi-part form data upload /// - public class ImageParameter : IBinaryParameter { + public class ImageContainer : IBinaryContainer { private Image image; private OutputSettings outputSettings; private string fileName; - public ImageParameter(Image image, OutputSettings outputSettings, string filename) { + public ImageContainer(Image image, OutputSettings outputSettings, string filename) { this.image = image; this.outputSettings = outputSettings; this.fileName = filename; } - public string ToBase64String() { + /// + /// Create a Base64String from the image by saving it to a memory stream and converting it. + /// Should be avoided if possible, as this uses a lot of memory. + /// + /// string + public string ToBase64String(Base64FormattingOptions formattingOptions) { using (MemoryStream stream = new MemoryStream()) { ImageOutput.SaveToStream(image, stream, outputSettings); - return System.Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length); + return System.Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length, formattingOptions); } } + /// + /// Create a byte[] from the image by saving it to a memory stream. + /// Should be avoided if possible, as this uses a lot of memory. + /// + /// byte[] + public byte[] ToByteArray() { + using (MemoryStream stream = new MemoryStream()) { + ImageOutput.SaveToStream(image, stream, outputSettings); + return stream.ToArray(); + } + } + + /// + /// Write Multipart Form Data directly to the HttpWebRequest response stream + /// + /// HttpWebRequest to write the multipart form data to + /// Parameters to include in the multipart form data public void WriteFormDataToStream(string boundary, string key, Stream formDataStream) { // Add just the first part of this param, since we will write the file data directly to the Stream string header = string.Format("--{0}\r\nContent-Disposition: form-data; name=\"{1}\"; filename=\"{2}\";\r\nContent-Type: {3}\r\n\r\n", @@ -373,6 +420,10 @@ namespace GreenshotPlugin.Core { ImageOutput.SaveToStream(image, formDataStream, outputSettings); } + /// + /// A plain "write data to stream" + /// + /// public void WriteToStream(Stream dataStream) { // Write the file data directly to the Stream, rather than serializing it to a string. ImageOutput.SaveToStream(image, dataStream, outputSettings); diff --git a/GreenshotPlugin/Core/OAuthHelper.cs b/GreenshotPlugin/Core/OAuthHelper.cs index 154e4a036..485fba707 100644 --- a/GreenshotPlugin/Core/OAuthHelper.cs +++ b/GreenshotPlugin/Core/OAuthHelper.cs @@ -378,7 +378,7 @@ namespace GreenshotPlugin.Core { /// contenttype for the postdata /// Data to post (MemoryStream) /// The web server response. - public string MakeOAuthRequest(HTTPMethod method, string requestURL, IDictionary parameters, string contentType, IBinaryParameter postData) { + public string MakeOAuthRequest(HTTPMethod method, string requestURL, IDictionary parameters, string contentType, IBinaryContainer postData) { if (parameters == null) { parameters = new Dictionary(); } @@ -482,7 +482,7 @@ namespace GreenshotPlugin.Core { /// /// IBinaryParameter /// Response from server - public string MakeRequest(HTTPMethod method, string requestURL, IDictionary parameters, string contentType, IBinaryParameter postData) { + public string MakeRequest(HTTPMethod method, string requestURL, IDictionary parameters, string contentType, IBinaryContainer postData) { if (parameters == null) { throw new ArgumentNullException("parameters"); } @@ -529,9 +529,9 @@ namespace GreenshotPlugin.Core { } else { StringBuilder form = new StringBuilder(); foreach (string parameterKey in requestParameters.Keys) { - if (parameters[parameterKey] is IBinaryParameter) { - IBinaryParameter binaryParameter = parameters[parameterKey] as IBinaryParameter; - form.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "{0}={1}&", UrlEncode3986(parameterKey), UrlEncode3986(binaryParameter.ToBase64String())); + if (parameters[parameterKey] is IBinaryContainer) { + IBinaryContainer binaryParameter = parameters[parameterKey] as IBinaryContainer; + form.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "{0}={1}&", UrlEncode3986(parameterKey), UrlEncode3986(binaryParameter.ToBase64String(Base64FormattingOptions.None))); } else { form.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, "{0}={1}&", UrlEncode3986(parameterKey), UrlEncode3986(string.Format("{0}",parameters[parameterKey]))); } diff --git a/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs b/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs index a67c5e4ff..20c35a858 100644 --- a/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs +++ b/GreenshotPlugin/Interfaces/Forms/ImageEditor.cs @@ -45,13 +45,6 @@ namespace Greenshot.Plugin { /// Bitmap Image GetImageForExport(); - /// - /// Will save the current Image in the supplied format to the given stream - /// - /// The stream the image is stored on - /// OutputSettings - void SaveToStream(Stream stream, OutputSettings outputSettings); - /// /// Get the ToolStripMenuItem where plugins can place their Menu entrys ///