mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
Added ResizeSettingsForm, language entries and removed unneeded usages.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2381 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
38de4875e0
commit
8be44214ce
9 changed files with 497 additions and 38 deletions
44
Greenshot/Forms/DropShadowSettingsForm.Designer.cs
generated
44
Greenshot/Forms/DropShadowSettingsForm.Designer.cs
generated
|
@ -1,4 +1,24 @@
|
|||
namespace Greenshot.Forms {
|
||||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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/>.
|
||||
*/
|
||||
namespace Greenshot.Forms {
|
||||
partial class DropShadowSettingsForm {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -152,31 +172,31 @@
|
|||
this.labelDarkness.LanguageKey = "editor_dropshadow_darkness";
|
||||
this.labelDarkness.Location = new System.Drawing.Point(12, 73);
|
||||
this.labelDarkness.Name = "labelDarkness";
|
||||
this.labelDarkness.Size = new System.Drawing.Size(52, 13);
|
||||
this.labelDarkness.Size = new System.Drawing.Size(92, 13);
|
||||
this.labelDarkness.TabIndex = 13;
|
||||
this.labelDarkness.Text = "Darkness";
|
||||
this.labelDarkness.Text = "Shadow darkness";
|
||||
//
|
||||
// labelOffset
|
||||
//
|
||||
this.labelOffset.AutoSize = true;
|
||||
this.labelOffset.LanguageKey = "editor_dropshadow_offset";
|
||||
this.labelOffset.Location = new System.Drawing.Point(12, 40);
|
||||
this.labelOffset.Location = new System.Drawing.Point(12, 35);
|
||||
this.labelOffset.Name = "labelOffset";
|
||||
this.labelOffset.Size = new System.Drawing.Size(35, 13);
|
||||
this.labelOffset.Size = new System.Drawing.Size(75, 13);
|
||||
this.labelOffset.TabIndex = 14;
|
||||
this.labelOffset.Text = "Offset";
|
||||
this.labelOffset.Text = "Shadow offset";
|
||||
//
|
||||
// labelThickness
|
||||
//
|
||||
this.labelThickness.AutoSize = true;
|
||||
this.labelThickness.LanguageKey = "editor_dropshadow_thickness";
|
||||
this.labelThickness.Location = new System.Drawing.Point(12, 14);
|
||||
this.labelThickness.Location = new System.Drawing.Point(12, 9);
|
||||
this.labelThickness.Name = "labelThickness";
|
||||
this.labelThickness.Size = new System.Drawing.Size(56, 13);
|
||||
this.labelThickness.Size = new System.Drawing.Size(94, 13);
|
||||
this.labelThickness.TabIndex = 15;
|
||||
this.labelThickness.Text = "Thickness";
|
||||
this.labelThickness.Text = "Shadow thickness";
|
||||
//
|
||||
// CreateShadowForm
|
||||
// DropShadowSettingsForm
|
||||
//
|
||||
this.AcceptButton = this.buttonOK;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -198,9 +218,9 @@
|
|||
this.LanguageKey = "editor_dropshadow_settings";
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "CreateShadowForm";
|
||||
this.Name = "DropShadowSettingsForm";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "CreateShadowForm";
|
||||
this.Text = "Dropshadow settings";
|
||||
((System.ComponentModel.ISupportInitialize)(this.thickness)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.offsetX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.offsetY)).EndInit();
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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 System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Greenshot.Core;
|
||||
using GreenshotPlugin.Core;
|
||||
|
|
|
@ -1212,12 +1212,26 @@ namespace Greenshot {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Currently unused
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void ResizeToolStripMenuItemClick(object sender, EventArgs e) {
|
||||
ResizeEffect resizeEffect = new ResizeEffect(surface.Image.Width, surface.Image.Height, true);
|
||||
DialogResult result = new ResizeSettingsForm(resizeEffect).ShowDialog(this);
|
||||
if (result == DialogResult.OK) {
|
||||
surface.ApplyBitmapEffect(resizeEffect);
|
||||
updateUndoRedoSurfaceDependencies();
|
||||
}
|
||||
}
|
||||
|
||||
void TornEdgesToolStripMenuItemClick(object sender, EventArgs e) {
|
||||
TornEdgeEffect tornEdgeEffect = new TornEdgeEffect();
|
||||
DialogResult result = new TornEdgeSettingsForm(tornEdgeEffect).ShowDialog(this);
|
||||
if (result == DialogResult.OK) {
|
||||
surface.ApplyBitmapEffect(tornEdgeEffect);
|
||||
updateUndoRedoSurfaceDependencies();
|
||||
surface.ApplyBitmapEffect(tornEdgeEffect);
|
||||
updateUndoRedoSurfaceDependencies();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
186
Greenshot/Forms/ResizeSettingsForm.Designer.cs
generated
Normal file
186
Greenshot/Forms/ResizeSettingsForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,186 @@
|
|||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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/>.
|
||||
*/
|
||||
namespace Greenshot.Forms {
|
||||
partial class ResizeSettingsForm {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// 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();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private GreenshotPlugin.Controls.GreenshotButton buttonOK;
|
||||
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;
|
||||
private GreenshotPlugin.Controls.GreenshotCheckBox checkbox_aspectratio;
|
||||
private GreenshotPlugin.Controls.GreenshotLabel label_width;
|
||||
private GreenshotPlugin.Controls.GreenshotLabel label_height;
|
||||
private System.Windows.Forms.TextBox textbox_height;
|
||||
private System.Windows.Forms.TextBox textbox_width;
|
||||
private System.Windows.Forms.ComboBox combobox_width;
|
||||
private System.Windows.Forms.ComboBox combobox_height;
|
||||
}
|
||||
}
|
171
Greenshot/Forms/ResizeSettingsForm.cs
Normal file
171
Greenshot/Forms/ResizeSettingsForm.cs
Normal file
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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 System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using Greenshot.Core;
|
||||
using GreenshotPlugin.Core;
|
||||
|
||||
namespace Greenshot.Forms {
|
||||
public partial class ResizeSettingsForm : BaseForm {
|
||||
private ResizeEffect effect;
|
||||
private string value_pixel;
|
||||
private string value_percent;
|
||||
private int newWidth, newHeight;
|
||||
|
||||
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");
|
||||
combobox_width.Items.Add(value_pixel);
|
||||
combobox_width.Items.Add(value_percent);
|
||||
combobox_width.SelectedItem = value_pixel;
|
||||
combobox_height.Items.Add(value_pixel);
|
||||
combobox_height.Items.Add(value_percent);
|
||||
combobox_height.SelectedItem = value_pixel;
|
||||
|
||||
textbox_width.Text = effect.Width.ToString();
|
||||
textbox_height.Text = effect.Height.ToString();
|
||||
newWidth = effect.Width;
|
||||
newHeight = effect.Height;
|
||||
combobox_width.SelectedIndexChanged += new System.EventHandler(this.combobox_SelectedIndexChanged);
|
||||
combobox_height.SelectedIndexChanged += new System.EventHandler(this.combobox_SelectedIndexChanged);
|
||||
|
||||
checkbox_aspectratio.Checked = effect.MaintainAspectRatio;
|
||||
}
|
||||
|
||||
private void checkValues() {
|
||||
if (value_pixel.Equals(combobox_width.SelectedItem)) {
|
||||
newWidth = int.Parse(textbox_width.Text);
|
||||
} else {
|
||||
newWidth = (int)(effect.Width * (100f / double.Parse(textbox_width.Text)));
|
||||
}
|
||||
if (value_pixel.Equals(combobox_height.SelectedItem)) {
|
||||
newHeight = int.Parse(textbox_height.Text);
|
||||
} else {
|
||||
newHeight = (int)(effect.Height * (100f / double.Parse(textbox_height.Text)));
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e) {
|
||||
checkValues();
|
||||
if (newWidth != effect.Width || newHeight != effect.Height) {
|
||||
effect.Width = newWidth;
|
||||
effect.Height = newHeight;
|
||||
effect.MaintainAspectRatio = checkbox_aspectratio.Checked;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
private bool validate(object sender) {
|
||||
TextBox textbox = sender as TextBox;
|
||||
if (textbox != null) {
|
||||
double numberEntered;
|
||||
if (!double.TryParse(textbox.Text, out numberEntered)) {
|
||||
textbox.BackColor = Color.Red;
|
||||
return false;
|
||||
} else {
|
||||
textbox.BackColor = Color.White;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void displayWidth() {
|
||||
int displayValue;
|
||||
if (value_percent.Equals(combobox_width.SelectedItem)) {
|
||||
displayValue = (int)(((double)newWidth / (double)effect.Width) * 100);
|
||||
} else {
|
||||
displayValue = newWidth;
|
||||
}
|
||||
textbox_width.Text = displayValue.ToString();
|
||||
}
|
||||
private void displayHeight() {
|
||||
int displayValue;
|
||||
if (value_percent.Equals(combobox_height.SelectedItem)) {
|
||||
displayValue = (int)(((double)newHeight / (double)effect.Height) * 100);
|
||||
} else {
|
||||
displayValue = newHeight;
|
||||
}
|
||||
textbox_height.Text = displayValue.ToString();
|
||||
}
|
||||
|
||||
private void textbox_KeyUp(object sender, KeyEventArgs e) {
|
||||
validate(sender);
|
||||
if (!checkbox_aspectratio.Checked) {
|
||||
return;
|
||||
}
|
||||
TextBox textbox = sender as TextBox;
|
||||
if (textbox.Text.Length == 0) {
|
||||
return;
|
||||
}
|
||||
bool isWidth = textbox == textbox_width;
|
||||
bool isPercent = false;
|
||||
if (isWidth) {
|
||||
isPercent = value_percent.Equals(combobox_width.SelectedItem);
|
||||
} else {
|
||||
isPercent = value_percent.Equals(combobox_height.SelectedItem);
|
||||
}
|
||||
double percent;
|
||||
if (isWidth) {
|
||||
if (isPercent) {
|
||||
percent = float.Parse(textbox_width.Text);
|
||||
newWidth = (int)(((double)effect.Width / 100d) * percent);
|
||||
} else {
|
||||
newWidth = int.Parse(textbox_width.Text);
|
||||
percent = ((double)double.Parse(textbox_width.Text) / (double)effect.Width) * 100d;
|
||||
}
|
||||
if (checkbox_aspectratio.Checked) {
|
||||
newHeight = (int)(((double)effect.Height / 100d) * percent);
|
||||
displayHeight();
|
||||
}
|
||||
} else {
|
||||
if (isPercent) {
|
||||
percent = int.Parse(textbox_height.Text);
|
||||
newHeight = (int)(((double)effect.Height / 100d) * percent);
|
||||
} else {
|
||||
newHeight = int.Parse(textbox_height.Text);
|
||||
percent = ((double)double.Parse(textbox_height.Text) / (double)effect.Height) * 100d;
|
||||
}
|
||||
if (checkbox_aspectratio.Checked) {
|
||||
newWidth = (int)(((double)effect.Width / 100d) * percent);
|
||||
displayWidth();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void textbox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
validate(sender);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void combobox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
displayWidth();
|
||||
displayHeight();
|
||||
}
|
||||
}
|
||||
}
|
42
Greenshot/Forms/TornEdgeSettingsForm.Designer.cs
generated
42
Greenshot/Forms/TornEdgeSettingsForm.Designer.cs
generated
|
@ -1,4 +1,24 @@
|
|||
namespace Greenshot.Forms {
|
||||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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/>.
|
||||
*/
|
||||
namespace Greenshot.Forms {
|
||||
partial class TornEdgeSettingsForm {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
@ -159,31 +179,31 @@
|
|||
//
|
||||
this.labelDarkness.AutoSize = true;
|
||||
this.labelDarkness.LanguageKey = "editor_dropshadow_darkness";
|
||||
this.labelDarkness.Location = new System.Drawing.Point(12, 73);
|
||||
this.labelDarkness.Location = new System.Drawing.Point(12, 69);
|
||||
this.labelDarkness.Name = "labelDarkness";
|
||||
this.labelDarkness.Size = new System.Drawing.Size(52, 13);
|
||||
this.labelDarkness.Size = new System.Drawing.Size(92, 13);
|
||||
this.labelDarkness.TabIndex = 13;
|
||||
this.labelDarkness.Text = "Darkness";
|
||||
this.labelDarkness.Text = "Shadow darkness";
|
||||
//
|
||||
// labelOffset
|
||||
//
|
||||
this.labelOffset.AutoSize = true;
|
||||
this.labelOffset.LanguageKey = "editor_dropshadow_offset";
|
||||
this.labelOffset.Location = new System.Drawing.Point(12, 40);
|
||||
this.labelOffset.Location = new System.Drawing.Point(12, 35);
|
||||
this.labelOffset.Name = "labelOffset";
|
||||
this.labelOffset.Size = new System.Drawing.Size(35, 13);
|
||||
this.labelOffset.Size = new System.Drawing.Size(75, 13);
|
||||
this.labelOffset.TabIndex = 14;
|
||||
this.labelOffset.Text = "Offset";
|
||||
this.labelOffset.Text = "Shadow offset";
|
||||
//
|
||||
// labelThickness
|
||||
//
|
||||
this.labelThickness.AutoSize = true;
|
||||
this.labelThickness.LanguageKey = "editor_dropshadow_thickness";
|
||||
this.labelThickness.Location = new System.Drawing.Point(12, 14);
|
||||
this.labelThickness.Location = new System.Drawing.Point(12, 9);
|
||||
this.labelThickness.Name = "labelThickness";
|
||||
this.labelThickness.Size = new System.Drawing.Size(56, 13);
|
||||
this.labelThickness.Size = new System.Drawing.Size(94, 13);
|
||||
this.labelThickness.TabIndex = 15;
|
||||
this.labelThickness.Text = "Thickness";
|
||||
this.labelThickness.Text = "Shadow thickness";
|
||||
//
|
||||
// toothsize
|
||||
//
|
||||
|
@ -311,7 +331,7 @@
|
|||
this.MinimizeBox = false;
|
||||
this.Name = "TornEdgeSettingsForm";
|
||||
this.ShowIcon = false;
|
||||
this.Text = "CreateShadowForm";
|
||||
this.Text = "Torn edges settings";
|
||||
((System.ComponentModel.ISupportInitialize)(this.thickness)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.offsetX)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.offsetY)).EndInit();
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2012 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 System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Greenshot.Core;
|
||||
using GreenshotPlugin.Core;
|
||||
|
|
|
@ -149,6 +149,12 @@
|
|||
<Compile Include="Forms\AnimatingBaseForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ResizeSettingsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ResizeSettingsForm.Designer.cs">
|
||||
<DependentUpon>ResizeSettingsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\TornEdgeSettingsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -94,7 +94,11 @@ Also, we would highly appreciate if you checked whether a tracker item already e
|
|||
<resource name="editor_drawline">Draw line (L)</resource>
|
||||
<resource name="editor_drawrectangle">Draw rectangle (R)</resource>
|
||||
<resource name="editor_drawtextbox">Add textbox (T)</resource>
|
||||
<resource name="editor_duplicate">Duplicate selected element</resource>
|
||||
<resource name="editor_dropshadow_settings">Dropshadow settings</resource>
|
||||
<resource name="editor_dropshadow_thickness">Shadow thickness</resource>
|
||||
<resource name="editor_dropshadow_offset">Shadow offset</resource>
|
||||
<resource name="editor_dropshadow_darkness">Shadow darkness</resource>
|
||||
<resource name="editor_duplicate">Duplicate selected element</resource>
|
||||
<resource name="editor_edit">Edit</resource>
|
||||
<resource name="editor_effects">Effects</resource>
|
||||
<resource name="editor_email">E-Mail</resource>
|
||||
|
@ -132,14 +136,20 @@ Also, we would highly appreciate if you checked whether a tracker item already e
|
|||
<resource name="editor_save">Save</resource>
|
||||
<resource name="editor_save_objects">Save objects to file</resource>
|
||||
<resource name="editor_saveas">Save as...</resource>
|
||||
<resource name="editor_selectall">Select all</resource>
|
||||
<resource name="editor_resize_pixel">Pixels</resource>
|
||||
<resource name="editor_resize_percent">Percent</resource>
|
||||
<resource name="editor_selectall">Select all</resource>
|
||||
<resource name="editor_senttoprinter">Print job was sent to '{0}'.</resource>
|
||||
<resource name="editor_shadow">Drop shadow</resource>
|
||||
<resource name="editor_storedtoclipboard">Image stored to clipboard.</resource>
|
||||
<resource name="editor_thickness">Line thickness</resource>
|
||||
<resource name="editor_title">Greenshot image editor</resource>
|
||||
<resource name="editor_torn_edge">Torn edge</resource>
|
||||
<resource name="editor_undo">Undo {0}</resource>
|
||||
<resource name="editor_tornedge_settings">Torn edges settings</resource>
|
||||
<resource name="editor_tornedge_toothsize">Tooth size</resource>
|
||||
<resource name="editor_tornedge_horizontaltoothrange">Horizontal tooth range</resource>
|
||||
<resource name="editor_tornedge_verticaltoothrange">Vertical tooth range</resource>
|
||||
<resource name="editor_undo">Undo {0}</resource>
|
||||
<resource name="editor_uponelevel">Up one level</resource>
|
||||
<resource name="editor_uptotop">Up to top</resource>
|
||||
<resource name="EmailFormat.MAPI">MAPI client</resource>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue