mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Applied my "patch" which refactors the complete codebase to have IEffect support, this is an interface which can be used to supply effects to a bitmap. These effects can now be passed to the OutputSettings (which now is called SurfaceOutputSettings) to control how the output is modified. This is very useful for e.g. OCR which needs a grayscale & resized image.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2377 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5541e2e1c7
commit
0c7e16a771
33 changed files with 212 additions and 148 deletions
|
@ -111,7 +111,7 @@ namespace GreenshotOfficePlugin {
|
|||
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
|
||||
string tmpFile = captureDetails.Filename;
|
||||
if (tmpFile == null || surface.Modified) {
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new OutputSettings(OutputFormat.png));
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings(OutputFormat.png));
|
||||
}
|
||||
if (workbookName != null) {
|
||||
ExcelExporter.InsertIntoExistingWorkbook(workbookName, tmpFile);
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace GreenshotOfficePlugin {
|
|||
// Outlook logic
|
||||
string tmpFile = captureDetails.Filename;
|
||||
if (tmpFile == null || surface.Modified) {
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new OutputSettings());
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings());
|
||||
} else {
|
||||
LOG.InfoFormat("Using already available file: {0}", tmpFile);
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace GreenshotOfficePlugin {
|
|||
string tmpFile = captureDetails.Filename;
|
||||
Size imageSize = Size.Empty;
|
||||
if (tmpFile == null || surface.Modified) {
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new OutputSettings());
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings());
|
||||
imageSize = surface.Image.Size;
|
||||
}
|
||||
if (presentationName != null) {
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace GreenshotOfficePlugin {
|
|||
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
|
||||
string tmpFile = captureDetails.Filename;
|
||||
if (tmpFile == null || surface.Modified) {
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new OutputSettings(OutputFormat.png));
|
||||
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings(OutputFormat.png));
|
||||
}
|
||||
if (documentCaption != null) {
|
||||
try {
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace Greenshot.Interop.Office {
|
|||
|
||||
public static void ExportToPage(ISurface surfaceToUpload, OneNotePage page) {
|
||||
using (MemoryStream pngStream = new MemoryStream()) {
|
||||
OutputSettings pngOutputSettings = new OutputSettings(OutputFormat.png, 100, false);
|
||||
SurfaceOutputSettings pngOutputSettings = new SurfaceOutputSettings(OutputFormat.png, 100, false);
|
||||
ImageOutput.SaveToStream(surfaceToUpload, pngStream, pngOutputSettings);
|
||||
string base64String = Convert.ToBase64String(pngStream.GetBuffer());
|
||||
string imageXmlStr = string.Format(XML_IMAGE_CONTENT, base64String, surfaceToUpload.Image.Width, surfaceToUpload.Image.Height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue