Added print image button to image editor

This commit is contained in:
Jaex 2014-09-26 08:58:04 +03:00
parent bfc62ccfc4
commit 0ec7a24240
9 changed files with 332 additions and 270 deletions

View file

@ -76,22 +76,23 @@ private void InitializeComponent() {
this.rotateCcwToolstripButton = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.btnResize = new System.Windows.Forms.ToolStripButton();
this.tsProperties = new Greenshot.Controls.ToolStripEx();
this.btnSaveClose = new System.Windows.Forms.ToolStripButton();
this.btnClose = new System.Windows.Forms.ToolStripButton();
this.btnCancelTasks = new System.Windows.Forms.ToolStripButton();
this.tsbSaveClose = new System.Windows.Forms.ToolStripButton();
this.tsbClose = new System.Windows.Forms.ToolStripButton();
this.tsbCancelTasks = new System.Windows.Forms.ToolStripButton();
this.tssTaskButtons = new System.Windows.Forms.ToolStripSeparator();
this.btnSave = new System.Windows.Forms.ToolStripButton();
this.btnSaveAs = new System.Windows.Forms.ToolStripButton();
this.btnClipboardCopy = new System.Windows.Forms.ToolStripButton();
this.btnUploadImage = new System.Windows.Forms.ToolStripButton();
this.tsbSaveImage = new System.Windows.Forms.ToolStripButton();
this.tsbSaveImageAs = new System.Windows.Forms.ToolStripButton();
this.tsbCopyImage = new System.Windows.Forms.ToolStripButton();
this.tsbUploadImage = new System.Windows.Forms.ToolStripButton();
this.tsbPrintImage = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.btnUndo = new System.Windows.Forms.ToolStripButton();
this.btnRedo = new System.Windows.Forms.ToolStripButton();
this.tsbUndo = new System.Windows.Forms.ToolStripButton();
this.tsbRedo = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.btnCut = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.btnCopy = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.btnPaste = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.btnDelete = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.tsbCut = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.tsbCopy = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.tsbPaste = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.tsbDelete = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.tsddbMenu = new System.Windows.Forms.ToolStripDropDownButton();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -497,22 +498,23 @@ private void InitializeComponent() {
this.tsProperties.Dock = System.Windows.Forms.DockStyle.None;
this.tsProperties.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tsProperties.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnSaveClose,
this.btnClose,
this.btnCancelTasks,
this.tsbSaveClose,
this.tsbClose,
this.tsbCancelTasks,
this.tssTaskButtons,
this.btnSave,
this.btnSaveAs,
this.btnClipboardCopy,
this.btnUploadImage,
this.tsbSaveImage,
this.tsbSaveImageAs,
this.tsbCopyImage,
this.tsbUploadImage,
this.tsbPrintImage,
this.toolStripSeparator2,
this.btnUndo,
this.btnRedo,
this.tsbUndo,
this.tsbRedo,
this.toolStripSeparator3,
this.btnCut,
this.btnCopy,
this.btnPaste,
this.btnDelete,
this.tsbCut,
this.tsbCopy,
this.tsbPaste,
this.tsbDelete,
this.toolStripSeparator6,
this.tsddbMenu,
this.toolStripSeparator5,
@ -552,152 +554,162 @@ private void InitializeComponent() {
this.tsProperties.Stretch = true;
this.tsProperties.TabIndex = 0;
//
// btnSaveClose
// tsbSaveClose
//
this.btnSaveClose.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnSaveClose.Image = global::Greenshot.Properties.Resources.tick;
this.btnSaveClose.Name = "btnSaveClose";
this.btnSaveClose.Size = new System.Drawing.Size(23, 24);
this.btnSaveClose.Text = "Save and close";
this.btnSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click);
this.tsbSaveClose.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSaveClose.Image = global::Greenshot.Properties.Resources.tick;
this.tsbSaveClose.Name = "tsbSaveClose";
this.tsbSaveClose.Size = new System.Drawing.Size(23, 24);
this.tsbSaveClose.Text = "Save and close";
this.tsbSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click);
//
// btnClose
// tsbClose
//
this.btnClose.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnClose.Image = global::Greenshot.Properties.Resources.slash;
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(23, 24);
this.btnClose.Text = "Close";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
this.tsbClose.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbClose.Image = global::Greenshot.Properties.Resources.slash;
this.tsbClose.Name = "tsbClose";
this.tsbClose.Size = new System.Drawing.Size(23, 24);
this.tsbClose.Text = "Close";
this.tsbClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnCancelTasks
// tsbCancelTasks
//
this.btnCancelTasks.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnCancelTasks.Image = global::Greenshot.Properties.Resources.minus_circle;
this.btnCancelTasks.Name = "btnCancelTasks";
this.btnCancelTasks.Size = new System.Drawing.Size(23, 24);
this.btnCancelTasks.Text = "Close and cancel tasks";
this.btnCancelTasks.Click += new System.EventHandler(this.btnCancelTasks_Click);
this.tsbCancelTasks.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbCancelTasks.Image = global::Greenshot.Properties.Resources.minus_circle;
this.tsbCancelTasks.Name = "tsbCancelTasks";
this.tsbCancelTasks.Size = new System.Drawing.Size(23, 24);
this.tsbCancelTasks.Text = "Close and cancel tasks";
this.tsbCancelTasks.Click += new System.EventHandler(this.btnCancelTasks_Click);
//
// tssTaskButtons
//
this.tssTaskButtons.Name = "tssTaskButtons";
this.tssTaskButtons.Size = new System.Drawing.Size(6, 27);
//
// btnSave
// tsbSaveImage
//
this.btnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(23, 24);
this.btnSave.Text = "Save image";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
this.tsbSaveImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSaveImage.Image = global::Greenshot.Properties.Resources.disk_black;
this.tsbSaveImage.Name = "tsbSaveImage";
this.tsbSaveImage.Size = new System.Drawing.Size(23, 24);
this.tsbSaveImage.Text = "Save image";
this.tsbSaveImage.Click += new System.EventHandler(this.btnSave_Click);
//
// btnSaveAs
// tsbSaveImageAs
//
this.btnSaveAs.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnSaveAs.Image = ((System.Drawing.Image)(resources.GetObject("btnSaveAs.Image")));
this.btnSaveAs.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnSaveAs.Name = "btnSaveAs";
this.btnSaveAs.Size = new System.Drawing.Size(23, 24);
this.btnSaveAs.Text = "Save image as...";
this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
this.tsbSaveImageAs.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSaveImageAs.Image = global::Greenshot.Properties.Resources.disks_black;
this.tsbSaveImageAs.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSaveImageAs.Name = "tsbSaveImageAs";
this.tsbSaveImageAs.Size = new System.Drawing.Size(23, 24);
this.tsbSaveImageAs.Text = "Save image as...";
this.tsbSaveImageAs.Click += new System.EventHandler(this.btnSaveAs_Click);
//
// btnClipboardCopy
// tsbCopyImage
//
this.btnClipboardCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnClipboardCopy.Image = ((System.Drawing.Image)(resources.GetObject("btnClipboardCopy.Image")));
this.btnClipboardCopy.Name = "btnClipboardCopy";
this.btnClipboardCopy.Size = new System.Drawing.Size(23, 24);
this.btnClipboardCopy.Text = "Copy to clipboard";
this.btnClipboardCopy.Click += new System.EventHandler(this.btnClipboardCopy_Click);
this.tsbCopyImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbCopyImage.Image = global::Greenshot.Properties.Resources.clipboard;
this.tsbCopyImage.Name = "tsbCopyImage";
this.tsbCopyImage.Size = new System.Drawing.Size(23, 24);
this.tsbCopyImage.Text = "Copy image to clipboard";
this.tsbCopyImage.Click += new System.EventHandler(this.btnClipboardCopy_Click);
//
// btnUploadImage
// tsbUploadImage
//
this.btnUploadImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnUploadImage.Image = ((System.Drawing.Image)(resources.GetObject("btnUploadImage.Image")));
this.btnUploadImage.Name = "btnUploadImage";
this.btnUploadImage.Size = new System.Drawing.Size(23, 24);
this.btnUploadImage.Text = "Upload image";
this.btnUploadImage.Click += new System.EventHandler(this.btnUploadImage_Click);
this.tsbUploadImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbUploadImage.Image = global::Greenshot.Properties.Resources.drive_globe;
this.tsbUploadImage.Name = "tsbUploadImage";
this.tsbUploadImage.Size = new System.Drawing.Size(23, 24);
this.tsbUploadImage.Text = "Upload image";
this.tsbUploadImage.Click += new System.EventHandler(this.btnUploadImage_Click);
//
// tsbPrintImage
//
this.tsbPrintImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbPrintImage.Image = global::Greenshot.Properties.Resources.printer;
this.tsbPrintImage.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbPrintImage.Name = "tsbPrintImage";
this.tsbPrintImage.Size = new System.Drawing.Size(23, 24);
this.tsbPrintImage.Text = "Print image";
this.tsbPrintImage.Click += new System.EventHandler(this.tsbPrintImage_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 27);
//
// btnUndo
// tsbUndo
//
this.btnUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnUndo.Enabled = false;
this.btnUndo.Image = global::Greenshot.Properties.Resources.undo;
this.btnUndo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnUndo.Name = "btnUndo";
this.btnUndo.Size = new System.Drawing.Size(23, 24);
this.btnUndo.Click += new System.EventHandler(this.UndoToolStripMenuItemClick);
this.tsbUndo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbUndo.Enabled = false;
this.tsbUndo.Image = global::Greenshot.Properties.Resources.undo;
this.tsbUndo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbUndo.Name = "tsbUndo";
this.tsbUndo.Size = new System.Drawing.Size(23, 24);
this.tsbUndo.Click += new System.EventHandler(this.UndoToolStripMenuItemClick);
//
// btnRedo
// tsbRedo
//
this.btnRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnRedo.Enabled = false;
this.btnRedo.Image = global::Greenshot.Properties.Resources.redo;
this.btnRedo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnRedo.Name = "btnRedo";
this.btnRedo.Size = new System.Drawing.Size(23, 24);
this.btnRedo.Click += new System.EventHandler(this.RedoToolStripMenuItemClick);
this.tsbRedo.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbRedo.Enabled = false;
this.tsbRedo.Image = global::Greenshot.Properties.Resources.redo;
this.tsbRedo.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRedo.Name = "tsbRedo";
this.tsbRedo.Size = new System.Drawing.Size(23, 24);
this.tsbRedo.Click += new System.EventHandler(this.RedoToolStripMenuItemClick);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 27);
//
// btnCut
// tsbCut
//
this.btnCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnCut.Enabled = false;
this.btnCut.Image = global::Greenshot.Properties.Resources.scissors;
this.btnCut.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnCut.LanguageKey = "editor_cuttoclipboard";
this.btnCut.Name = "btnCut";
this.btnCut.Size = new System.Drawing.Size(23, 24);
this.btnCut.Text = "Cut";
this.btnCut.Click += new System.EventHandler(this.CutToolStripMenuItemClick);
this.tsbCut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbCut.Enabled = false;
this.tsbCut.Image = global::Greenshot.Properties.Resources.scissors;
this.tsbCut.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbCut.LanguageKey = "editor_cuttoclipboard";
this.tsbCut.Name = "tsbCut";
this.tsbCut.Size = new System.Drawing.Size(23, 24);
this.tsbCut.Text = "Cut";
this.tsbCut.Click += new System.EventHandler(this.CutToolStripMenuItemClick);
//
// btnCopy
// tsbCopy
//
this.btnCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnCopy.Enabled = false;
this.btnCopy.Image = global::Greenshot.Properties.Resources.images;
this.btnCopy.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnCopy.LanguageKey = "editor_copytoclipboard";
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(23, 24);
this.btnCopy.Text = "Copy";
this.btnCopy.Click += new System.EventHandler(this.CopyToolStripMenuItemClick);
this.tsbCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbCopy.Enabled = false;
this.tsbCopy.Image = global::Greenshot.Properties.Resources.images;
this.tsbCopy.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbCopy.LanguageKey = "editor_copytoclipboard";
this.tsbCopy.Name = "tsbCopy";
this.tsbCopy.Size = new System.Drawing.Size(23, 24);
this.tsbCopy.Text = "Copy";
this.tsbCopy.Click += new System.EventHandler(this.CopyToolStripMenuItemClick);
//
// btnPaste
// tsbPaste
//
this.btnPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnPaste.Enabled = false;
this.btnPaste.Image = global::Greenshot.Properties.Resources.clipboard_paste_image;
this.btnPaste.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnPaste.LanguageKey = "editor_pastefromclipboard";
this.btnPaste.Name = "btnPaste";
this.btnPaste.Size = new System.Drawing.Size(23, 24);
this.btnPaste.Text = "Paste";
this.btnPaste.Click += new System.EventHandler(this.PasteToolStripMenuItemClick);
this.tsbPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbPaste.Enabled = false;
this.tsbPaste.Image = global::Greenshot.Properties.Resources.clipboard_paste_image;
this.tsbPaste.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbPaste.LanguageKey = "editor_pastefromclipboard";
this.tsbPaste.Name = "tsbPaste";
this.tsbPaste.Size = new System.Drawing.Size(23, 24);
this.tsbPaste.Text = "Paste";
this.tsbPaste.Click += new System.EventHandler(this.PasteToolStripMenuItemClick);
//
// btnDelete
// tsbDelete
//
this.btnDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnDelete.Enabled = false;
this.btnDelete.Image = global::Greenshot.Properties.Resources.cross;
this.btnDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnDelete.LanguageKey = "editor_deleteelement";
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(23, 24);
this.btnDelete.Text = "Delete";
this.btnDelete.Click += new System.EventHandler(this.RemoveObjectToolStripMenuItemClick);
this.tsbDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbDelete.Enabled = false;
this.tsbDelete.Image = global::Greenshot.Properties.Resources.cross;
this.tsbDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDelete.LanguageKey = "editor_deleteelement";
this.tsbDelete.Name = "tsbDelete";
this.tsbDelete.Size = new System.Drawing.Size(23, 24);
this.tsbDelete.Text = "Delete";
this.tsbDelete.Click += new System.EventHandler(this.RemoveObjectToolStripMenuItemClick);
//
// toolStripSeparator6
//
@ -1600,12 +1612,12 @@ private void InitializeComponent() {
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem pasteToolStripMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem copyToolStripMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem cutToolStripMenuItem;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnCut;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnCopy;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnPaste;
private System.Windows.Forms.ToolStripButton btnUndo;
private System.Windows.Forms.ToolStripButton btnRedo;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnDelete;
private GreenshotPlugin.Controls.GreenshotToolStripButton tsbCut;
private GreenshotPlugin.Controls.GreenshotToolStripButton tsbCopy;
private GreenshotPlugin.Controls.GreenshotToolStripButton tsbPaste;
private System.Windows.Forms.ToolStripButton tsbUndo;
private System.Windows.Forms.ToolStripButton tsbRedo;
private GreenshotPlugin.Controls.GreenshotToolStripButton tsbDelete;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnEllipse;
@ -1616,22 +1628,23 @@ private void InitializeComponent() {
private Greenshot.Controls.ToolStripColorButton btnFillColor;
private Greenshot.Controls.ToolStripColorButton btnLineColor;
private GreenshotPlugin.Controls.GreenshotToolStripMenuItem autoCropToolStripMenuItem;
private System.Windows.Forms.ToolStripButton btnSaveClose;
private System.Windows.Forms.ToolStripButton btnClose;
private System.Windows.Forms.ToolStripButton tsbSaveClose;
private System.Windows.Forms.ToolStripButton tsbClose;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator tssTaskButtons;
private System.Windows.Forms.ToolStripButton btnClipboardCopy;
private System.Windows.Forms.ToolStripButton btnUploadImage;
private System.Windows.Forms.ToolStripButton btnSaveAs;
private System.Windows.Forms.ToolStripButton btnCancelTasks;
private System.Windows.Forms.ToolStripButton btnSave;
private System.Windows.Forms.ToolStripButton tsbCopyImage;
private System.Windows.Forms.ToolStripButton tsbUploadImage;
private System.Windows.Forms.ToolStripButton tsbSaveImageAs;
private System.Windows.Forms.ToolStripButton tsbCancelTasks;
private System.Windows.Forms.ToolStripButton tsbSaveImage;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnSpeechBubble;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnStepLabel;
private System.Windows.Forms.ToolStripButton btnResize;
private System.Windows.Forms.ToolStripDropDownButton tsddbMenu;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripButton tsbPrintImage;
}
}

View file

@ -45,10 +45,11 @@ namespace Greenshot
/// </summary>
public partial class ImageEditorForm : BaseForm, IImageEditor
{
public event Action<Image, string> ImageSaveRequested;
public event Func<Image, string, string> ImageSaveAsRequested;
public event Action<Image> ClipboardCopyRequested;
public event Action<Image> ImageUploadRequested;
public event Func<Image, string, string> ImageSaveAsRequested;
public event Action<Image, string> ImageSaveRequested;
public event Action<Image> PrintImageRequested;
private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection<EditorConfiguration>();
private static List<string> ignoreDestinations = new List<string> { };
@ -94,7 +95,7 @@ public bool IsTaskWork
}
set
{
isTaskWork = btnSaveClose.Visible = btnClose.Visible = btnCancelTasks.Visible = tssTaskButtons.Visible = value;
isTaskWork = tsbSaveClose.Visible = tsbClose.Visible = tsbCancelTasks.Visible = tssTaskButtons.Visible = value;
}
}
@ -326,7 +327,7 @@ public void SetImagePath(string fullpath)
//updateStatusLabel(string.Format("Image saved to {0}.", fullpath), fileSavedStatusContextMenu);
SetTitle(Path.GetFileName(fullpath));
btnSave.Enabled = File.Exists(surface.LastSaveFullPath);
tsbSaveImage.Enabled = File.Exists(surface.LastSaveFullPath);
}
private void surface_DrawingModeChanged(object source, SurfaceDrawingModeEventArgs eventArgs)
@ -575,7 +576,7 @@ private void ImageEditorFormActivated(object sender, EventArgs e)
updateClipboardSurfaceDependencies();
updateUndoRedoSurfaceDependencies();
btnSave.Enabled = File.Exists(surface.LastSaveFullPath);
tsbSaveImage.Enabled = File.Exists(surface.LastSaveFullPath);
}
private void ImageEditorFormFormClosing(object sender, FormClosingEventArgs e)
@ -749,17 +750,17 @@ private void updateUndoRedoSurfaceDependencies()
return;
}
bool canUndo = surface.CanUndo;
btnUndo.Enabled = canUndo;
tsbUndo.Enabled = canUndo;
undoToolStripMenuItem.Enabled = canUndo;
string undoText = "Undo";
btnUndo.Text = undoText;
tsbUndo.Text = undoText;
undoToolStripMenuItem.Text = undoText;
bool canRedo = surface.CanRedo;
btnRedo.Enabled = canRedo;
tsbRedo.Enabled = canRedo;
redoToolStripMenuItem.Enabled = canRedo;
string redoText = "Redo";
btnRedo.Text = redoText;
tsbRedo.Text = redoText;
redoToolStripMenuItem.Text = redoText;
}
@ -774,9 +775,9 @@ private void updateClipboardSurfaceDependencies()
bool actionAllowedForSelection = hasItems && !controlsDisabledDueToConfirmable;
// buttons
btnCut.Enabled = actionAllowedForSelection;
btnCopy.Enabled = actionAllowedForSelection;
btnDelete.Enabled = actionAllowedForSelection;
tsbCut.Enabled = actionAllowedForSelection;
tsbCopy.Enabled = actionAllowedForSelection;
tsbDelete.Enabled = actionAllowedForSelection;
// menus
removeObjectToolStripMenuItem.Enabled = actionAllowedForSelection;
@ -786,7 +787,7 @@ private void updateClipboardSurfaceDependencies()
// check dependencies for the Clipboard
bool hasClipboard = ClipboardHelper.ContainsFormat(SUPPORTED_CLIPBOARD_FORMATS) || ClipboardHelper.ContainsImage();
btnPaste.Enabled = hasClipboard && !controlsDisabledDueToConfirmable;
tsbPaste.Enabled = hasClipboard && !controlsDisabledDueToConfirmable;
pasteToolStripMenuItem.Enabled = hasClipboard && !controlsDisabledDueToConfirmable;
}
@ -1213,27 +1214,6 @@ private void ImageEditorFormResize(object sender, EventArgs e)
}
}
public void OnClipboardCopyRequested()
{
if (ClipboardCopyRequested != null)
{
using (Image img = surface.GetImageForExport())
{
ClipboardCopyRequested(img);
}
}
}
public void OnImageUploadRequested()
{
if (ImageUploadRequested != null)
{
// Image will be disposed in upload task
Image img = surface.GetImageForExport();
ImageUploadRequested(img);
}
}
public void OnImageSaveRequested()
{
if (ImageSaveRequested != null && File.Exists(surface.LastSaveFullPath))
@ -1262,6 +1242,38 @@ public void OnImageSaveAsRequested()
}
}
public void OnClipboardCopyRequested()
{
if (ClipboardCopyRequested != null)
{
using (Image img = surface.GetImageForExport())
{
ClipboardCopyRequested(img);
}
}
}
public void OnImageUploadRequested()
{
if (ImageUploadRequested != null)
{
// Image will be disposed in upload task
Image img = surface.GetImageForExport();
ImageUploadRequested(img);
}
}
public void OnPrintImageRequested()
{
if (PrintImageRequested != null)
{
using (Image img = surface.GetImageForExport())
{
PrintImageRequested(img);
}
}
}
private void btnSaveClose_Click(object sender, EventArgs e)
{
OnImageSaveRequested();
@ -1304,6 +1316,11 @@ private void btnUploadImage_Click(object sender, EventArgs e)
OnImageUploadRequested();
}
private void tsbPrintImage_Click(object sender, EventArgs e)
{
OnPrintImageRequested();
}
private void tsddbMenu_Click(object sender, EventArgs e)
{
updateClipboardSurfaceDependencies();

View file

@ -317,60 +317,6 @@
<metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFnSURBVDhPpY1NSwJRGIUV/C+zc6MwoAtBd9ImYf6B
jqKioLgQRAlc9UcUrMgB6WMg0hBz48qdCzeBBEIJZoLg6Z4Lyi1kkrrwzL287znPuAD8C/lxu91ngguj
VjOPgVl2VMFVvV4XT2D7CzzMsiOee8F1tVrFZrvFerNxhBlm2VEFVqVSwYcIvK9WjjDDLDuqoFMul/G2
XmO2WDjCDLPsqILbUqmEV/GH6XzuCDPMsqMK7EKhgOF4jJfl0hFmmGVHFTzkcjkkEomjYJYdVdDNZDLw
+/3w+XwH4W5HsVikoKsK+slkErquYzB4Rq/39A3OuDMMA4FAAPl8noK+KhjG43EEg0HY9iM0TZNY1o2E
M+4oCIfDyGazFAxVwcg0TYRCIbTb9/ImzWZbsptREI1GkU6nKRjtBeKcCCZer/ez1bpDJBKRNBodyW5G
QSwWQyqVYmmiCnhOBTOPx3N+CO5+cLkX/B24vgCZXIPOR4ZOhQAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnSaveAs.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFlSURBVDhPjZCxasJgFIUVn8BXSKZmEozFwSxZhC516d6l
NZCACkbIIFJw6puIVShILdSCWLSQPXTuoGMRiq2D9faeEEpifksOfCD/ufdGvpQo6XT6hrm76HSuj4Ee
c8FKNFwMu90u7YnoZ7+PgXf0mAtWouHivt1u0/duR5/bbQy8o8dcsBINFyPHceiDh1frdQy8o8dcsBIN
F4+2bZPrebTabGLgHT3mhMJOSqW3q1aLLhsNH1mWSVVVqlarf9TrdRyYJBaWzWYpn8/7hwqFAjWbTRyY
JhamaRotFq9ULBb937VaDQfmiYWp6imNx8/+crlcJtM0ccBNLCyXU2kweCJd16lSqZBhGMS+PRyYQEhY
0CGBsPdMJnPLS8sQfRyYWpbly4GkMDFhonAxx1cgB5JmsxcfoTBRuHBxAIOQJEkSDYcjsbAjOWM8RVG+
IAl/vdd7EAv7J+fMEpLC4C1EnzlIKvULraTQUmJxMIIAAAAASUVORK5CYII=
</value>
</data>
<data name="btnClipboardCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFmSURBVDhPjZA/S4JRFIfPZGtfoCkIhIYihAiitnAV
+wItNjlEUNDQEBQWgRSCNhQZKojfw+WA0ZT2IhFWJorlX/x7uj9TMW5cGh44nPvc5325JCIDAus0Ztdp
t7ndbpfCM8SF3aQzujcZCCkYHC/SfXjf+5bJWAIwYzc6h6sFLteI04EtSWw7JJl8kFTqUbLZ3ADM2OEM
Dlwt4F8dLCUcvhOf70yCwSuJRGISjyfk+uZW/P4LiUZjUGTo/g6crxD31dDt9+XJsv4EZ3Dgju6NA6fL
xB0ltLpdI3DgaoETB3Gr15N6u20EDlwtcLRE3Oh05KvZNAIHrhY4XCCuqi+UajUjcOBqgYN54s9WS/KV
ihE4cLXAnp24pH4xVy4bgQNXC+zMERcaDXkuFo3AgasFvLPE7/W6WIWCEThwtYBnhvhVPVI6nzcCB64W
2Jwm/lAP9FKtGoEDVws4pyi0YSP+D3B/7gl9AyX59rP4A1D4AAAAAElFTkSuQmCC
</value>
</data>
<data name="btnUploadImage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vgAADr4B6kKxwAAAAr1JREFUOE+dkt9LU2Ecxs+qq268sD8hGJEJ4sgox4wlhngRTTJJJEJt4k0huaXp
wi1NrTTDH8NKTZDcUNtSK44/UpcePG6oW6lrcyud4XSjiajo5Ol916AL7cbn8IGX836e9/3COcy+AIJj
FT/ERyuWqgWVnvcUuqbv6F7Y+l8gOFI8JT9ZPcfXmb1rzbafu5ZF3267fWMtus7O0z3qhOUDkm2UCFWj
lqZBzw6/CVSNLOPD4ibousezthOlGbNQJ2zvj+Daq4arjRP+7C4ncg0LyHu3gHyDE/d6XHgxs4kbZI86
Yf2AJD4eytbbgrHPeFxotOJ8rRk3u/3I/bgBkXoU8RouSJ2w/S8ymUyUmpp6+/hFpV1S83nvTCWP2OfT
EFVbEK0agqxzB+eqbJA08nvUoS7thMopKSkn5HK5IhAIIEPTCWmFCZIGOxKbvuPyS4J2Hok1VmT2biG9
zYUr99sxPe1GVpZcQbtMcnLyqdra2hafz4c3fRxi8zuR1rqIzA4vbukJOi/Sm5zQWLZwVtGNJ80sJicd
0GgqW2iXSUpKStDpdIP0ALvdjoKX/RAVs8hoceOu4XeI69o5xKtZ5Dw1gmW50AH19a8HaZeRSqVpHMc5
VlZWMDMzQwQWD+o6cOmhAVHKPpxW9CKhuAt3KlrR3PwWRuMQOG4Oev0nB+0yYrE4b3l5GcFgENvbW1hf
D2B11QuPZwlutwtOp5OwQHATFgm/CKswmb6Cdpm4uLh8v9+P+fk52GxWWCxmcsM4RkaGMTAwEJqIZfsJ
g4RhgonAwWx2gHaZmJiYAo/HA4PBgPLyMqjVpVCpSlBUVAilUgmFglJIKCGUEsqQQx6TyQraZYRCYZHR
aHT9HdWB2dlv5DNNgecnMDY2RkQT4QthnDBBMIcm0GrbXLTLREZGSiMiIh4dBtoN/UyHD8P8AQS4BWf/
e825AAAAAElFTkSuQmCC
</value>
</data>
<data name="pixelizeToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6

View file

@ -416,6 +416,21 @@
<ItemGroup>
<None Include="Icons\fugue\gear.png" />
</ItemGroup>
<ItemGroup>
<None Include="Icons\fugue\disk-black.png" />
</ItemGroup>
<ItemGroup>
<None Include="Icons\fugue\disks-black.png" />
</ItemGroup>
<ItemGroup>
<None Include="Icons\fugue\clipboard.png" />
</ItemGroup>
<ItemGroup>
<None Include="Icons\fugue\drive-globe.png" />
</ItemGroup>
<ItemGroup>
<None Include="Icons\fugue\printer.png" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<PropertyGroup>
<PreBuildEvent>

View file

@ -60,6 +60,16 @@ internal Resources() {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap clipboard {
get {
object obj = ResourceManager.GetObject("clipboard", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -80,6 +90,36 @@ internal static System.Drawing.Bitmap cross {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap disk_black {
get {
object obj = ResourceManager.GetObject("disk-black", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap disks_black {
get {
object obj = ResourceManager.GetObject("disks-black", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap drive_globe {
get {
object obj = ResourceManager.GetObject("drive-globe", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -320,6 +360,16 @@ internal static System.Drawing.Bitmap notification_counter_20_plus {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap printer {
get {
object obj = ResourceManager.GetObject("printer", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="notification_counter_06" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-06.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_19" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-19.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -130,11 +127,14 @@
<data name="redo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_12" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-12.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="clipboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\clipboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="scissors" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\scissors.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -142,6 +142,9 @@
<data name="notification_counter_04" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-04.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_17" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-17.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -157,6 +160,9 @@
<data name="notification_counter_18" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-18.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_03" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-03.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="minus-circle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\minus-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -166,8 +172,8 @@
<data name="notification_counter_14" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-14.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_03" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-03.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="tick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\tick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="clipboard-paste-image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\clipboard-paste-image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -175,14 +181,14 @@
<data name="notification_counter_11" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_07" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-07.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_02" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-02.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\tick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="disks-black" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\disks-black.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_08" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-08.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="images" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\images.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -190,20 +196,26 @@
<data name="notification_counter_20_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-20-plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_08" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-08.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="notification_counter_07" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-07.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="drive-globe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\drive-globe.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_10" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-10.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_17" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-17.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="disk-black" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\disk-black.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_06" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-06.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_13" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-13.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="cross" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notification_counter_15" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icons\notification-counter-15.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -211,4 +223,7 @@
<data name="gear" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\gear.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="printer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\fugue\printer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -666,7 +666,8 @@ public static Image AnnotateImage(Image img, string imgPath, bool allowSave, str
Action<Image> clipboardCopyRequested,
Action<Image> imageUploadRequested,
Action<Image, string> imageSaveRequested,
Func<Image, string, string> imageSaveAsRequested)
Func<Image, string, string> imageSaveAsRequested,
Action<Image> printImageRequested)
{
if (!IniConfig.isInitialized)
{
@ -685,6 +686,7 @@ public static Image AnnotateImage(Image img, string imgPath, bool allowSave, str
editor.ImageUploadRequested += imageUploadRequested;
editor.ImageSaveRequested += imageSaveRequested;
editor.ImageSaveAsRequested += imageSaveAsRequested;
editor.PrintImageRequested += printImageRequested;
DialogResult result = editor.ShowDialog();

View file

@ -41,8 +41,6 @@ namespace ShareX
{
public static class TaskHelpers
{
private const int PropertyTagSoftwareUsed = 0x0131;
public static ImageData PrepareImage(Image img, TaskSettings taskSettings)
{
ImageData imageData = new ImageData();
@ -231,7 +229,27 @@ public static Image AnnotateImage(Image img, string imgPath)
string newFilePath = null;
Program.MainForm.InvokeSafe(() => newFilePath = ImageHelpers.SaveImageFileDialog(x, filePath));
return newFilePath;
});
},
x => Program.MainForm.InvokeSafe(() => TaskHelpers.PrintImage(x)));
}
public static void PrintImage(Image img)
{
if (Program.Settings.DontShowPrintSettingsDialog)
{
using (PrintHelper printHelper = new PrintHelper(img))
{
printHelper.Settings = Program.Settings.PrintSettings;
printHelper.Print();
}
}
else
{
using (PrintForm printForm = new PrintForm(img, Program.Settings.PrintSettings))
{
printForm.ShowDialog();
}
}
}
public static Image AddImageEffects(Image img, TaskSettings taskSettings)

View file

@ -472,21 +472,7 @@ private bool DoAfterCaptureJobs()
if (Info.TaskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.SendImageToPrinter))
{
if (Program.Settings.DontShowPrintSettingsDialog)
{
using (PrintHelper printHelper = new PrintHelper(tempImage))
{
printHelper.Settings = Program.Settings.PrintSettings;
printHelper.Print();
}
}
else
{
using (PrintForm printForm = new PrintForm(tempImage, Program.Settings.PrintSettings))
{
printForm.ShowDialog();
}
}
TaskHelpers.PrintImage(tempImage);
}
if (Info.TaskSettings.AfterCaptureJob.HasFlagAny(AfterCaptureTasks.SaveImageToFile, AfterCaptureTasks.SaveImageToFileWithDialog, AfterCaptureTasks.UploadImageToHost))