Refactoring some more classes, making easier code in plug-ins possible. Needed this for better testing some problems with the CreateShadow function.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2094 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-25 11:36:52 +00:00
commit 9488200886
20 changed files with 128 additions and 190 deletions

View file

@ -103,13 +103,13 @@ namespace GreenshotJiraPlugin {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
string filename = Path.GetFileName(jiraPlugin.Host.GetFilename(config.UploadFormat, captureDetails));
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()) {
jiraPlugin.Host.SaveToStream(image, stream, outputSettings);
ImageOutput.SaveToStream(image, stream, outputSettings);
}
// COPY stream to buffer
buffer = stream.ToArray();
@ -136,7 +136,7 @@ namespace GreenshotJiraPlugin {
if (result == DialogResult.OK) {
using (MemoryStream stream = new MemoryStream()) {
using (Image image = surface.GetImageForExport()) {
jiraPlugin.Host.SaveToStream(image, stream, outputSettings);
ImageOutput.SaveToStream(image, stream, outputSettings);
}
// COPY stream to buffer
buffer = stream.ToArray();