Greenshot image editor resize button

This commit is contained in:
Jaex 2014-09-19 21:09:20 +03:00
parent 30e773e4c8
commit 64560f1a06
10 changed files with 218 additions and 170 deletions

View file

@ -69,7 +69,7 @@ public void ShowAndWait(string title, string text, ThreadStart waitDelegate)
this.title = title;
Text = title;
label_pleasewait.Text = text;
cancelButton.Text = Language.GetString("CANCEL");
cancelButton.Text = "Cancel";
// Make sure the form is shown.
Show();

View file

@ -156,11 +156,11 @@ private static void SetDataObject(IDataObject ido, bool copy)
string clipboardOwner = GetClipboardOwner();
if (clipboardOwner != null)
{
messageText = Language.GetFormattedString("clipboard_inuse", clipboardOwner);
messageText = string.Format("Greenshot wasn't able to write to the clipboard as the process {0} blocked the access.", clipboardOwner);
}
else
{
messageText = Language.GetString("clipboard_error");
messageText = "An unexpected error occured while writing to the clipboard.";
}
LOG.Error(messageText, ee);
}
@ -199,11 +199,11 @@ public static IDataObject GetDataObject()
string clipboardOwner = GetClipboardOwner();
if (clipboardOwner != null)
{
messageText = Language.GetFormattedString("clipboard_inuse", clipboardOwner);
messageText = string.Format("Greenshot wasn't able to write to the clipboard as the process {0} blocked the access.", clipboardOwner);
}
else
{
messageText = Language.GetString("clipboard_error");
messageText = "An unexpected error occured while writing to the clipboard.";
}
LOG.Error(messageText, ee);
}

View file

@ -467,7 +467,8 @@ public static string SaveWithDialog(ISurface surface, ICaptureDetails captureDet
}
catch (ExternalException)
{
MessageBox.Show(Language.GetFormattedString("error_nowriteaccess", saveImageFileDialog.FileName).Replace(@"\\", @"\"), Language.GetString("error"));
MessageBox.Show(string.Format("Cannot save file to {0}.\r\nPlease check write accessibility of the selected storage location.",
saveImageFileDialog.FileName).Replace(@"\\", @"\"), "Error");
}
}
}

View file

@ -74,6 +74,7 @@ protected override void Dispose(bool disposing)
this.btnCrop = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.rotateCwToolstripButton = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.rotateCcwToolstripButton = new GreenshotPlugin.Controls.GreenshotToolStripButton();
this.btnResize = new System.Windows.Forms.ToolStripButton();
this.menuStrip1 = new Greenshot.Controls.MenuStripEx();
this.editToolStripMenuItem = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -251,7 +252,8 @@ protected override void Dispose(bool disposing)
this.toolStripSeparator13,
this.btnCrop,
this.rotateCwToolstripButton,
this.rotateCcwToolstripButton});
this.rotateCcwToolstripButton,
this.btnResize});
this.toolStrip2.Location = new System.Drawing.Point(0, 0);
this.toolStrip2.Name = "toolStrip2";
this.toolStrip2.Padding = new System.Windows.Forms.Padding(3, 3, 3, 0);
@ -491,6 +493,16 @@ protected override void Dispose(bool disposing)
this.rotateCcwToolstripButton.Text = "Rotate counter clockwise (Control + ,)";
this.rotateCcwToolstripButton.Click += new System.EventHandler(this.RotateCcwToolstripButtonClick);
//
// btnResize
//
this.btnResize.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.btnResize.Image = ((System.Drawing.Image)(resources.GetObject("btnResize.Image")));
this.btnResize.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnResize.Name = "btnResize";
this.btnResize.Size = new System.Drawing.Size(22, 20);
this.btnResize.Text = "Resize";
this.btnResize.Click += new System.EventHandler(this.btnResize_Click);
//
// menuStrip1
//
this.menuStrip1.ClickThrough = true;
@ -1740,5 +1752,6 @@ protected override void Dispose(bool disposing)
private System.Windows.Forms.ToolStripButton btnSave;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnSpeechBubble;
private GreenshotPlugin.Controls.GreenshotToolStripButton btnStepLabel;
private System.Windows.Forms.ToolStripButton btnResize;
}
}

View file

@ -1298,6 +1298,23 @@ private void RotateCcwToolstripButtonClick(object sender, EventArgs e)
updateUndoRedoSurfaceDependencies();
}
/// <summary>
/// Open the resize settings from, and resize if ok was pressed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnResize_Click(object sender, EventArgs e)
{
ResizeEffect resizeEffect = new ResizeEffect(surface.Image.Width, surface.Image.Height, true);
// TODO: Use the Resize SettingsForm to make it possible to change the default values
DialogResult result = new ResizeSettingsForm(resizeEffect).ShowDialog(this);
if (result == DialogResult.OK)
{
surface.ApplyBitmapEffect(resizeEffect);
updateUndoRedoSurfaceDependencies();
}
}
private void InvertToolStripMenuItemClick(object sender, EventArgs e)
{
surface.ApplyBitmapEffect(new InvertEffect());

View file

@ -211,26 +211,25 @@
<data name="btnSpeechBubble.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG1SURBVDhPzY67SyNRFIdPJulFrFYLsbS1s7DYP2ARRBsl
ID7ZZd1FxEIxDkZtbKJR1BSxcRBfnZqFJJUSLKIRDcQXvjKJM4mOcWQmMSFynKPXwmUVt/MHH/fec3/f
5cLniq8NClY7zF89v7jmPz+57rUOroegPc3ojjqs/jqrv6Hc1/ul58jLe9LylphRo1nMXSLm4phRL7Jp
OSgeefs91KEu056z0g4lfr7MrsqBKGbOELVDg4O/MGaZE1TjG1G/rdRODtMBln9wVmlvNoS6UboLv4+2
j9K2O0QO0wEW2rl+XY3omArhC3llHTV5HhVxDBPnQyid9j1Be+XYqZPDdIC5NtOAltpN480W5q/XjW+6
MXk+bJTt/0SO8GlymA4gtHCt4qYrnFP8eBubwBvR8Sap2Cge+FvD5DDdeKAJSpe6ip2xyJSkJwTULt1v
EtsZlBY6i5zkMP05M41QIXwvdASF+sBVZDSRis/nssklzCYX8d6A1qBQF6AOdZn2OuNWKJq2mmsmGzjb
VINpwsD1woPiQVqpw+ofC88D56i1VI7UmucINv7/2KotVbZvpjV2/DQBeATEdG4gYWca5wAAAABJRU5E
rkJggg==
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVDhPzY67L0NRHMd/vbWLmDCI0WozGPwBIhEW0kQ8
KsQjIgaibhSLQb3iMdTiRrw2Wkl1Io2hVKhUSbx6W/e2dVVpSxvyc38cA0HYfJNPzjm/8/2cHPhf2dBD
+lqLttjaytWuN3Odlhaui6A9zeiOOqz+MWttkL/RndV1YuOtCXlHvFd8SUxdIaYCeK9cJhOyUzyx9Vqp
Q12mvWW1AXLsfJ4xKjt8+HCOGDtW8X5CnT2cYjSw5bMbco3kMB1gpYnTSQdzLoyrpTv3z8SOUNo1u8hh
OsBiA9d7F/XEMeLCd56UTYzJC6iIoxi8GEDprOcV2ive4Tg5TAeY12v6biP7CbzZwafrTfWbZgxdDKpl
45fIh3yCHKYDCHVcvbg9404pdrz1T+CNaPqWiH8EvfZ6NzlMVx+ogdzljuwxv2dKigcFjF2Zv8W/1y8t
tmeOkcP0t8xWQ4HQmGFyCpWOsGckGA4spJKhZUyGlvBRhVanUOGgDnWZ9jHjOsic1mnLJqs4w1SVZkJl
5p1nxYq0UofVfxeeB85UnlY4VK6dJ9j47zGUphUZSjQWdvw3AXgBZvdt/AbQj2UAAAAASUVORK5CYII=
</value>
</data>
<data name="btnStepLabel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE5SURBVDhP7ZHNSkJRFIX3fqvGNXDoAzhxcFXEP1BBnCg+
RFSzmjQKoaCgzCKQqDCIKC7mQNLkjvKqFNwfc7fu7eDo0ANEH+zJOeusvfc69Me4IlrvEDVviDr3RJdP
zGcvzMcD5sMh89aIaE1J9QSPrUjEdhIJmaVSMs3lxKtUROp1cQ3DGjNvKqmeoLOXTIodj4tjmhIwzedF
ApNGQ96Ym0qqJxjbz2TkE92HhhEaTAqFH4NaTUZYRUn1PDK3F8Wi+Hj0ns2uDJblsiyrVUEWp0qqx2S+
DoR+qSSWMhin0+IgiwXOnplvlVTPA/NdGBg6ev1+aOD2ejJHLj5M2szY8hfwCy07Fpt/weQDk0ywzgwh
upjmNRqd7xGdK6meC6KNFtHRCVEXaXUPUPuoXdQOzrdxr6T/rCD6BjREwGXyfU9MAAAAAElFTkSuQmCC
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE4SURBVDhP7ZFPS0JREMVnvlXrWrh069LFUxH/gQriRvFD
RLWrTasQCgrKLAKJCoOI4mEuJE3eKp9KwftjTue9Lq4ufYDoB7O599wzM+fSH+OKaL1D1Lwh6twTXT4x
n70wHw+YD4fMWyOiNSXVEzy2IhHbSSRklkrJNJcTr1IRqdfFNQxrzLyppHqCzl4yKXY8Lo5pSsA0nxcJ
TBoNeWNuKqmeYGw/k5FPdB8aRmgwKRR+DGo1GWEVJdXzyNxeFIvi49F7NrsyWJbLsqxWBVmcKqkek/k6
EPqlkljKYJxOi4MsFjh7Zr5VUj0PzHdhYOjo9fuhgdvryRy5+DBpM2PLX8AvtOxYbP4Fkw9MMsE6M4To
YprXaHS+R3SupHouiDZaREcnRF2k1T1A7aN2UTs438a9kv6zgugbK4/AX0C4XXEAAAAASUVORK5CYII=
</value>
</data>
<data name="btnHighlight.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -311,6 +310,19 @@
Jmy7NWXVscfL9ANPgA1QTluVu+/yi61bzz5ddfTmm40Vi061q6avSpBPX64A1gwCZlE3JtVPf3Ll4PVX
u7ece7Zpyd6n+y2iboINkIxZVLZo/90V28493bznyqsdp26/ObT19JO1TlVbqiVjF/qLhk7hYXBIerbM
Mfn5f2QMEgMZIBQ+OwiI6/DgIJC6IQ0YGADxitTt0c6Z7QAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnResize.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGISURBVDhPxZLdK4NhGMbfQ/4EWinmAEeIRGGLpJBolowU
U8pHvo6IEi1HRApzgBO0aIWIpom0pFDkayiUrxlpH5nZZffjmfYeGOXAr66D+76vXz31vsKfUWseQanS
WIx8FRDq+Ry2ULVfoaTj+leyD+qTx4aCpiMm59XvG/MbD/FTqOfvfSGvNIHwBAhBPa6ISVAu493jQfYg
oBgFCkcA1RhQMw30rgIrh2B36nFFTHSOHq9uNzrntqHfc2N+HzAcA7odwHgCmB/A7tTjipiITB3sLhdi
mwtRNz4A0/kDDm6cOL1/x6UVeHKA3anHFTHhGTN4cTohUZYjSl0LWVsXivu1aJjUo8ewiUXzPbtTjyti
IrMWYLXbkVg9CnnLFAq6l6Ae2kLr7Dn61p8xcfDG7tTjipiY3DU4vE+02Gzfhu7U48oncUW77HtK07Xr
8Yod/BRp6vCGvyeklJ4huezCGBaWFuQdQ7wJDRSJJCmY+uR5Z0GQVdyBIq+4Ff9Z30A9n8NX/4ogfABH
/2l//yD6wAAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2013 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Greenshot.Forms {
namespace Greenshot {
partial class ResizeSettingsForm {
/// <summary>
/// Required designer variable.
@ -43,131 +43,127 @@ partial class ResizeSettingsForm {
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton();
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.checkbox_aspectratio = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.label_width = new GreenshotPlugin.Controls.GreenshotLabel();
this.label_height = new GreenshotPlugin.Controls.GreenshotLabel();
this.textbox_height = new System.Windows.Forms.TextBox();
this.textbox_width = new System.Windows.Forms.TextBox();
this.combobox_width = new System.Windows.Forms.ComboBox();
this.combobox_height = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(76, 87);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 6;
this.buttonOK.Text = "Ok";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(157, 87);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 7;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// checkbox_aspectratio
//
this.checkbox_aspectratio.AutoSize = true;
this.checkbox_aspectratio.LanguageKey = "editor_resize_aspectratio";
this.checkbox_aspectratio.Location = new System.Drawing.Point(22, 64);
this.checkbox_aspectratio.Name = "checkbox_aspectratio";
this.checkbox_aspectratio.Size = new System.Drawing.Size(124, 17);
this.checkbox_aspectratio.TabIndex = 5;
this.checkbox_aspectratio.Text = "Maintain aspect ratio";
this.checkbox_aspectratio.UseVisualStyleBackColor = true;
//
// label_width
//
this.label_width.AutoSize = true;
this.label_width.LanguageKey = "editor_resize_width";
this.label_width.Location = new System.Drawing.Point(19, 15);
this.label_width.Name = "label_width";
this.label_width.Size = new System.Drawing.Size(35, 13);
this.label_width.TabIndex = 14;
this.label_width.Text = "Width";
//
// label_height
//
this.label_height.AutoSize = true;
this.label_height.LanguageKey = "editor_resize_height";
this.label_height.Location = new System.Drawing.Point(19, 38);
this.label_height.Name = "label_height";
this.label_height.Size = new System.Drawing.Size(38, 13);
this.label_height.TabIndex = 15;
this.label_height.Text = "Height";
//
// textbox_height
//
this.textbox_height.Location = new System.Drawing.Point(90, 38);
this.textbox_height.Name = "textbox_height";
this.textbox_height.Size = new System.Drawing.Size(69, 20);
this.textbox_height.TabIndex = 3;
this.textbox_height.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textbox_KeyUp);
this.textbox_height.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating);
//
// textbox_width
//
this.textbox_width.Location = new System.Drawing.Point(90, 12);
this.textbox_width.Name = "textbox_width";
this.textbox_width.Size = new System.Drawing.Size(69, 20);
this.textbox_width.TabIndex = 1;
this.textbox_width.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textbox_KeyUp);
this.textbox_width.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating);
//
// combobox_width
//
this.combobox_width.FormattingEnabled = true;
this.combobox_width.Location = new System.Drawing.Point(165, 11);
this.combobox_width.Name = "combobox_width";
this.combobox_width.Size = new System.Drawing.Size(65, 21);
this.combobox_width.TabIndex = 2;
//
// combobox_height
//
this.combobox_height.FormattingEnabled = true;
this.combobox_height.ItemHeight = 13;
this.combobox_height.Location = new System.Drawing.Point(165, 38);
this.combobox_height.Name = "combobox_height";
this.combobox_height.Size = new System.Drawing.Size(65, 21);
this.combobox_height.TabIndex = 19;
//
// ResizeSettingsForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(244, 122);
this.ControlBox = false;
this.Controls.Add(this.combobox_height);
this.Controls.Add(this.combobox_width);
this.Controls.Add(this.textbox_width);
this.Controls.Add(this.textbox_height);
this.Controls.Add(this.label_height);
this.Controls.Add(this.label_width);
this.Controls.Add(this.checkbox_aspectratio);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.LanguageKey = "editor_resize_settings";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ResizeSettingsForm";
this.ShowIcon = false;
this.Text = "Resize settings";
this.ResumeLayout(false);
this.PerformLayout();
this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton();
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.checkbox_aspectratio = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.label_width = new GreenshotPlugin.Controls.GreenshotLabel();
this.label_height = new GreenshotPlugin.Controls.GreenshotLabel();
this.textbox_height = new System.Windows.Forms.TextBox();
this.textbox_width = new System.Windows.Forms.TextBox();
this.combobox_width = new System.Windows.Forms.ComboBox();
this.combobox_height = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(76, 87);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 6;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(157, 87);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 7;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// checkbox_aspectratio
//
this.checkbox_aspectratio.AutoSize = true;
this.checkbox_aspectratio.Location = new System.Drawing.Point(22, 64);
this.checkbox_aspectratio.Name = "checkbox_aspectratio";
this.checkbox_aspectratio.Size = new System.Drawing.Size(124, 17);
this.checkbox_aspectratio.TabIndex = 5;
this.checkbox_aspectratio.Text = "Maintain aspect ratio";
this.checkbox_aspectratio.UseVisualStyleBackColor = true;
//
// label_width
//
this.label_width.AutoSize = true;
this.label_width.Location = new System.Drawing.Point(19, 15);
this.label_width.Name = "label_width";
this.label_width.Size = new System.Drawing.Size(38, 13);
this.label_width.TabIndex = 14;
this.label_width.Text = "Width:";
//
// label_height
//
this.label_height.AutoSize = true;
this.label_height.Location = new System.Drawing.Point(19, 38);
this.label_height.Name = "label_height";
this.label_height.Size = new System.Drawing.Size(41, 13);
this.label_height.TabIndex = 15;
this.label_height.Text = "Height:";
//
// textbox_height
//
this.textbox_height.Location = new System.Drawing.Point(90, 38);
this.textbox_height.Name = "textbox_height";
this.textbox_height.Size = new System.Drawing.Size(69, 20);
this.textbox_height.TabIndex = 3;
this.textbox_height.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textbox_KeyUp);
this.textbox_height.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating);
//
// textbox_width
//
this.textbox_width.Location = new System.Drawing.Point(90, 12);
this.textbox_width.Name = "textbox_width";
this.textbox_width.Size = new System.Drawing.Size(69, 20);
this.textbox_width.TabIndex = 1;
this.textbox_width.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textbox_KeyUp);
this.textbox_width.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating);
//
// combobox_width
//
this.combobox_width.FormattingEnabled = true;
this.combobox_width.Location = new System.Drawing.Point(165, 11);
this.combobox_width.Name = "combobox_width";
this.combobox_width.Size = new System.Drawing.Size(65, 21);
this.combobox_width.TabIndex = 2;
//
// combobox_height
//
this.combobox_height.FormattingEnabled = true;
this.combobox_height.ItemHeight = 13;
this.combobox_height.Location = new System.Drawing.Point(165, 38);
this.combobox_height.Name = "combobox_height";
this.combobox_height.Size = new System.Drawing.Size(65, 21);
this.combobox_height.TabIndex = 4;
//
// ResizeSettingsForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(244, 122);
this.ControlBox = false;
this.Controls.Add(this.combobox_height);
this.Controls.Add(this.combobox_width);
this.Controls.Add(this.textbox_width);
this.Controls.Add(this.textbox_height);
this.Controls.Add(this.label_height);
this.Controls.Add(this.label_width);
this.Controls.Add(this.checkbox_aspectratio);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.LanguageKey = "";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ResizeSettingsForm";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Resize settings";
this.ResumeLayout(false);
this.PerformLayout();
}

View file

@ -1,31 +1,31 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2013 Thomas Braun, Jens Klingen, Robin Krom
*
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Greenshot.Core;
using GreenshotPlugin.Core;
using System;
using System.Drawing;
using System.Windows.Forms;
using Greenshot.Core;
using GreenshotPlugin.Core;
namespace Greenshot.Forms
namespace Greenshot
{
/// <summary>
/// A form to set the resize settings
@ -42,8 +42,8 @@ public ResizeSettingsForm(ResizeEffect effect)
this.effect = effect;
InitializeComponent();
this.Icon = GreenshotResources.getGreenshotIcon();
value_pixel = Language.GetString("editor_resize_pixel");
value_percent = Language.GetString("editor_resize_percent");
value_pixel = "Pixels";
value_percent = "Percent";
combobox_width.Items.Add(value_pixel);
combobox_width.Items.Add(value_percent);
combobox_width.SelectedItem = value_pixel;
@ -125,16 +125,24 @@ private void textbox_KeyUp(object sender, KeyEventArgs e)
{
return;
}
if (!checkbox_aspectratio.Checked)
{
return;
}
TextBox textbox = sender as TextBox;
if (textbox.Text.Length == 0)
{
return;
}
bool isWidth = textbox == textbox_width;
if (!checkbox_aspectratio.Checked)
{
if (isWidth)
{
newWidth = double.Parse(textbox_width.Text);
}
else
{
newHeight = double.Parse(textbox_height.Text);
}
return;
}
bool isPercent = false;
if (isWidth)
{
@ -189,7 +197,7 @@ private void textbox_Validating(object sender, System.ComponentModel.CancelEvent
}
/// <summary>
///
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@ -205,4 +213,4 @@ private void combobox_SelectedIndexChanged(object sender, EventArgs e)
}
}
}
}
}

View file

@ -252,12 +252,12 @@
<Compile Include="Forms\ImageEditorForm.Designer.cs">
<DependentUpon>ImageEditorForm.cs</DependentUpon>
</Compile>
<None Include="Forms\ResizeSettingsForm.cs">
<Compile Include="Forms\ResizeSettingsForm.cs">
<SubType>Form</SubType>
</None>
<None Include="Forms\ResizeSettingsForm.Designer.cs">
</Compile>
<Compile Include="Forms\ResizeSettingsForm.Designer.cs">
<DependentUpon>ResizeSettingsForm.cs</DependentUpon>
</None>
</Compile>
<None Include="Forms\TornEdgeSettingsForm.cs">
<SubType>Form</SubType>
</None>

View file

@ -861,7 +861,8 @@ public override IMessage Invoke(IMessage myMessage)
{
destinationName = _InterceptType.FullName;
}
DialogResult result = MessageBox.Show(Language.GetFormattedString("com_rejected", destinationName), Language.GetString("com_rejected_title"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
DialogResult result = MessageBox.Show(string.Format("The destination {0} rejected Greenshot access, probably a dialog is open. Close the dialog and try again.",
destinationName), "Greenshot access rejected", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
if (result == DialogResult.OK)
{
continue;