ImageBeautifierForm improvements

This commit is contained in:
Jaex 2023-04-24 23:14:38 +03:00
parent b7bb8d7fe0
commit 2ec6429270
11 changed files with 359 additions and 133 deletions

View file

@ -43,9 +43,14 @@ private void InitializeComponent()
this.lblRoundedCornerValue = new System.Windows.Forms.Label(); this.lblRoundedCornerValue = new System.Windows.Forms.Label();
this.lblShadowSizeValue = new System.Windows.Forms.Label(); this.lblShadowSizeValue = new System.Windows.Forms.Label();
this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); this.tlpMain = new System.Windows.Forms.TableLayoutPanel();
this.pOptions = new System.Windows.Forms.Panel();
this.pbBackground = new System.Windows.Forms.PictureBox();
this.pbPreview = new ShareX.HelpersLib.MyPictureBox(); this.pbPreview = new ShareX.HelpersLib.MyPictureBox();
this.pOptions = new System.Windows.Forms.Panel();
this.btnPrint = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnUpload = new System.Windows.Forms.Button();
this.btnSaveAs = new System.Windows.Forms.Button();
this.btnCopy = new System.Windows.Forms.Button();
this.pbBackground = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.tbMargin)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbMargin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbPadding)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbPadding)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbRoundedCorner)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbRoundedCorner)).BeginInit();
@ -216,8 +221,28 @@ private void InitializeComponent()
this.tlpMain.Size = new System.Drawing.Size(1384, 761); this.tlpMain.Size = new System.Drawing.Size(1384, 761);
this.tlpMain.TabIndex = 15; this.tlpMain.TabIndex = 15;
// //
// pbPreview
//
this.pbPreview.BackColor = System.Drawing.SystemColors.Window;
this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbPreview.DrawCheckeredBackground = true;
this.pbPreview.EnableRightClickMenu = true;
this.pbPreview.FullscreenOnClick = true;
this.pbPreview.Location = new System.Drawing.Point(335, 0);
this.pbPreview.Margin = new System.Windows.Forms.Padding(0);
this.pbPreview.Name = "pbPreview";
this.pbPreview.PictureBoxBackColor = System.Drawing.SystemColors.Window;
this.pbPreview.ShowImageSizeLabel = true;
this.pbPreview.Size = new System.Drawing.Size(1049, 761);
this.pbPreview.TabIndex = 12;
//
// pOptions // pOptions
// //
this.pOptions.Controls.Add(this.btnPrint);
this.pOptions.Controls.Add(this.btnSave);
this.pOptions.Controls.Add(this.btnUpload);
this.pOptions.Controls.Add(this.btnSaveAs);
this.pOptions.Controls.Add(this.btnCopy);
this.pOptions.Controls.Add(this.pbBackground); this.pOptions.Controls.Add(this.pbBackground);
this.pOptions.Controls.Add(this.lblMargin); this.pOptions.Controls.Add(this.lblMargin);
this.pOptions.Controls.Add(this.lblShadowSizeValue); this.pOptions.Controls.Add(this.lblShadowSizeValue);
@ -239,6 +264,60 @@ private void InitializeComponent()
this.pOptions.Size = new System.Drawing.Size(329, 755); this.pOptions.Size = new System.Drawing.Size(329, 755);
this.pOptions.TabIndex = 0; this.pOptions.TabIndex = 0;
// //
// btnPrint
//
this.btnPrint.Image = global::ShareX.MediaLib.Properties.Resources.printer;
this.btnPrint.Location = new System.Drawing.Point(264, 696);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(56, 48);
this.btnPrint.TabIndex = 19;
this.btnPrint.UseVisualStyleBackColor = true;
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.Image = global::ShareX.MediaLib.Properties.Resources.disk_black;
this.btnSave.Location = new System.Drawing.Point(72, 696);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(56, 48);
this.btnSave.TabIndex = 18;
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnUpload
//
this.btnUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnUpload.Image = global::ShareX.MediaLib.Properties.Resources.upload_cloud;
this.btnUpload.Location = new System.Drawing.Point(200, 696);
this.btnUpload.Name = "btnUpload";
this.btnUpload.Size = new System.Drawing.Size(56, 48);
this.btnUpload.TabIndex = 17;
this.btnUpload.UseVisualStyleBackColor = true;
this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click);
//
// btnSaveAs
//
this.btnSaveAs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSaveAs.Image = global::ShareX.MediaLib.Properties.Resources.disks_black;
this.btnSaveAs.Location = new System.Drawing.Point(136, 696);
this.btnSaveAs.Name = "btnSaveAs";
this.btnSaveAs.Size = new System.Drawing.Size(56, 48);
this.btnSaveAs.TabIndex = 16;
this.btnSaveAs.UseVisualStyleBackColor = true;
this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
//
// btnCopy
//
this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCopy.Image = global::ShareX.MediaLib.Properties.Resources.document_copy;
this.btnCopy.Location = new System.Drawing.Point(8, 696);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(56, 48);
this.btnCopy.TabIndex = 15;
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// pbBackground // pbBackground
// //
this.pbBackground.Cursor = System.Windows.Forms.Cursors.Hand; this.pbBackground.Cursor = System.Windows.Forms.Cursors.Hand;
@ -249,18 +328,6 @@ private void InitializeComponent()
this.pbBackground.TabStop = false; this.pbBackground.TabStop = false;
this.pbBackground.Click += new System.EventHandler(this.pbBackground_Click); this.pbBackground.Click += new System.EventHandler(this.pbBackground_Click);
// //
// pbPreview
//
this.pbPreview.BackColor = System.Drawing.SystemColors.Window;
this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.pbPreview.DrawCheckeredBackground = true;
this.pbPreview.Location = new System.Drawing.Point(335, 0);
this.pbPreview.Margin = new System.Windows.Forms.Padding(0);
this.pbPreview.Name = "pbPreview";
this.pbPreview.PictureBoxBackColor = System.Drawing.SystemColors.Window;
this.pbPreview.Size = new System.Drawing.Size(1049, 761);
this.pbPreview.TabIndex = 12;
//
// ImageBeautifierForm // ImageBeautifierForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
@ -269,6 +336,7 @@ private void InitializeComponent()
this.Controls.Add(this.tlpMain); this.Controls.Add(this.tlpMain);
this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.MinimumSize = new System.Drawing.Size(1000, 600);
this.Name = "ImageBeautifierForm"; this.Name = "ImageBeautifierForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@ -305,5 +373,10 @@ private void InitializeComponent()
private System.Windows.Forms.Panel pOptions; private System.Windows.Forms.Panel pOptions;
private HelpersLib.MyPictureBox pbPreview; private HelpersLib.MyPictureBox pbPreview;
private System.Windows.Forms.PictureBox pbBackground; private System.Windows.Forms.PictureBox pbBackground;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnUpload;
private System.Windows.Forms.Button btnSaveAs;
private System.Windows.Forms.Button btnCopy;
private System.Windows.Forms.Button btnPrint;
} }
} }

View file

@ -36,12 +36,12 @@ public partial class ImageBeautifierForm : Form
public Bitmap SourceImage { get; private set; } public Bitmap SourceImage { get; private set; }
public Bitmap PreviewImage { get; private set; } public Bitmap PreviewImage { get; private set; }
public ImageBeautifierOptions Options { get; private set; } public ImageBeautifierOptions Options { get; private set; }
public string FilePath { get; private set; }
private bool isReady, isBusy, isPending; private bool isReady, isBusy, isPending;
public ImageBeautifierForm(Bitmap sourceImage, ImageBeautifierOptions options = null) private ImageBeautifierForm(ImageBeautifierOptions options = null)
{ {
SourceImage = sourceImage;
Options = options; Options = options;
if (Options == null) if (Options == null)
@ -63,6 +63,17 @@ public ImageBeautifierForm(Bitmap sourceImage, ImageBeautifierOptions options =
isReady = true; isReady = true;
} }
public ImageBeautifierForm(Bitmap sourceImage, ImageBeautifierOptions options = null) : this(options)
{
SourceImage = sourceImage;
}
public ImageBeautifierForm(string filePath, ImageBeautifierOptions options = null) : this(options)
{
FilePath = filePath;
SourceImage = ImageHelpers.LoadImage(filePath);
}
private void UpdateUI() private void UpdateUI()
{ {
lblMarginValue.Text = tbMargin.Value.ToString(); lblMarginValue.Text = tbMargin.Value.ToString();
@ -190,6 +201,45 @@ private async void tbRoundedCorner_Scroll(object sender, EventArgs e)
await UpdatePreview(); await UpdatePreview();
} }
private void btnCopy_Click(object sender, EventArgs e)
{
if (PreviewImage != null)
{
ClipboardHelpers.CopyImage(PreviewImage);
}
}
private void btnSave_Click(object sender, EventArgs e)
{
if (PreviewImage != null && !string.IsNullOrEmpty(FilePath))
{
ImageHelpers.SaveImage(PreviewImage, FilePath);
}
}
private void btnSaveAs_Click(object sender, EventArgs e)
{
if (PreviewImage != null)
{
string filePath = ImageHelpers.SaveImageFileDialog(PreviewImage, FilePath);
if (!string.IsNullOrEmpty(filePath))
{
FilePath = filePath;
}
}
}
private void btnUpload_Click(object sender, EventArgs e)
{
}
private void btnPrint_Click(object sender, EventArgs e)
{
}
private async void tbShadowSize_Scroll(object sender, EventArgs e) private async void tbShadowSize_Scroll(object sender, EventArgs e)
{ {
await UpdatePreview(); await UpdatePreview();

View file

@ -19,7 +19,7 @@ namespace ShareX.MediaLib.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -114,6 +114,36 @@ internal class Resources {
} }
} }
/// <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 document_copy {
get {
object obj = ResourceManager.GetObject("document-copy", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to FFmpeg error. /// Looks up a localized string similar to FFmpeg error.
/// </summary> /// </summary>
@ -141,6 +171,16 @@ internal class Resources {
} }
} }
/// <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> /// <summary>
/// Looks up a localized string similar to Start encoding. /// Looks up a localized string similar to Start encoding.
/// </summary> /// </summary>
@ -168,6 +208,16 @@ internal class Resources {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap upload_cloud {
get {
object obj = ResourceManager.GetObject("upload-cloud", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Browse for media file. /// Looks up a localized string similar to Browse for media file.
/// </summary> /// </summary>

View file

@ -1,117 +1,146 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
Version 1.3 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
The primary goals of this format is to allow a simple XML format : using a System.ComponentModel.TypeConverter
that is mostly human readable. The generation and parsing of the : and then encoded with base64 encoding.
various data types are done through the TypeConverter classes -->
associated with the data types. <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
Example: <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
... ado.net/XML headers & schema ... <xsd:choice maxOccurs="unbounded">
<resheader name="resmimetype">text/microsoft-resx</resheader> <xsd:element name="metadata">
<resheader name="version">1.3</resheader> <xsd:complexType>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <xsd:sequence>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <xsd:element name="value" type="xsd:string" minOccurs="0" />
<data name="Name1">this is my long string</data> </xsd:sequence>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <xsd:attribute name="name" use="required" type="xsd:string" />
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <xsd:attribute name="type" type="xsd:string" />
[base64 mime encoded serialized .NET Framework object] <xsd:attribute name="mimetype" type="xsd:string" />
</data> <xsd:attribute ref="xml:space" />
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> </xsd:complexType>
[base64 mime encoded string representing a byte array form of the .NET Framework object] </xsd:element>
</data> <xsd:element name="assembly">
<xsd:complexType>
There are any number of "resheader" rows that contain simple <xsd:attribute name="alias" type="xsd:string" />
name/value pairs. <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
Each data row contains a name, and value. The row also contains a </xsd:element>
type or mimetype. Type corresponds to a .NET class that support <xsd:element name="data">
text/value conversion through the TypeConverter architecture. <xsd:complexType>
Classes that don't support this are serialized and stored with the <xsd:sequence>
mimetype set. <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
The mimetype is used for serialized objects, and tells the </xsd:sequence>
ResXResourceReader how to depersist the object. This is currently not <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
extensible. For a given mimetype the value must be set accordingly: <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
Note - application/x-microsoft.net.object.binary.base64 is the format <xsd:attribute ref="xml:space" />
that the ResXResourceWriter will generate, however the reader can </xsd:complexType>
read any of the formats listed below. </xsd:element>
<xsd:element name="resheader">
mimetype: application/x-microsoft.net.object.binary.base64 <xsd:complexType>
value : The object must be serialized with <xsd:sequence>
: System.Serialization.Formatters.Binary.BinaryFormatter <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
: and then encoded with base64 encoding. </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
mimetype: application/x-microsoft.net.object.soap.base64 </xsd:complexType>
value : The object must be serialized with </xsd:element>
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter </xsd:choice>
: and then encoded with base64 encoding. </xsd:complexType>
</xsd:element>
mimetype: application/x-microsoft.net.object.bytearray.base64 </xsd:schema>
value : The object must be serialized into a byte array <resheader name="resmimetype">
: using a System.ComponentModel.TypeConverter <value>text/microsoft-resx</value>
: and then encoded with base64 encoding. </resheader>
--> <resheader name="version">
<value>2.0</value>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> </resheader>
<xsd:element name="root" msdata:IsDataSet="true"> <resheader name="reader">
<xsd:complexType> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<xsd:choice maxOccurs="unbounded"> </resheader>
<xsd:element name="data"> <resheader name="writer">
<xsd:complexType> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<xsd:sequence> </resheader>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <data name="document-copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
</xsd:sequence> <value>..\Resources\document-copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="VideoThumbnailerForm_btnBrowse_Click_Browse_for_media_file" xml:space="preserve">
<value>Browse for media file</value>
</data> </data>
<data name="ThumbnailsSuccessfullyGenerated" xml:space="preserve"> <data name="ThumbnailsSuccessfullyGenerated" xml:space="preserve">
<value>Thumbnails successfully generated.</value> <value>Thumbnails successfully generated.</value>
</data> </data>
<data name="LowerQualitySize" xml:space="preserve"> <data name="disks-black" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Lower quality/size</value> <value>..\Resources\disks-black.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AlignmentTop" xml:space="preserve">
<value>Top</value>
</data>
<data name="StopEncoding" xml:space="preserve">
<value>Stop encoding</value>
</data> </data>
<data name="HigherQualitySize" xml:space="preserve"> <data name="HigherQualitySize" xml:space="preserve">
<value>Higher quality/size</value> <value>Higher quality/size</value>
</data> </data>
<data name="StopEncoding" xml:space="preserve"> <data name="AlignmentBottom" xml:space="preserve">
<value>Stop encoding</value> <value>Bottom</value>
</data>
<data name="AlignmentRight" xml:space="preserve">
<value>Right</value>
</data> </data>
<data name="StartEncoding" xml:space="preserve"> <data name="StartEncoding" xml:space="preserve">
<value>Start encoding</value> <value>Start encoding</value>
@ -119,22 +148,28 @@
<data name="FFmpegError" xml:space="preserve"> <data name="FFmpegError" xml:space="preserve">
<value>FFmpeg error</value> <value>FFmpeg error</value>
</data> </data>
<data name="AlignmentTop" xml:space="preserve"> <data name="AlignmentVerticalCenter" xml:space="preserve">
<value>Top</value>
</data>
<data name="AlignmentHorizontalCenter" xml:space="preserve">
<value>Center</value> <value>Center</value>
</data> </data>
<data name="AlignmentBottom" xml:space="preserve"> <data name="upload-cloud" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Bottom</value> <value>..\Resources\upload-cloud.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="VideoThumbnailerForm_btnBrowse_Click_Browse_for_media_file" xml:space="preserve">
<value>Browse for media file</value>
</data> </data>
<data name="AlignmentLeft" xml:space="preserve"> <data name="AlignmentLeft" xml:space="preserve">
<value>Left</value> <value>Left</value>
</data> </data>
<data name="AlignmentVerticalCenter" xml:space="preserve"> <data name="AlignmentHorizontalCenter" xml:space="preserve">
<value>Center</value> <value>Center</value>
</data> </data>
<data name="AlignmentRight" xml:space="preserve"> <data name="LowerQualitySize" xml:space="preserve">
<value>Right</value> <value>Lower quality/size</value>
</data>
<data name="disk-black" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\disk-black.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>..\Resources\printer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -436,6 +436,21 @@
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" /> <EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
<EmbeddedResource Include="Properties\Resources.zh-TW.resx" /> <EmbeddedResource Include="Properties\Resources.zh-TW.resx" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\document-copy.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\disk-black.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\disks-black.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\upload-cloud.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\printer.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -1019,7 +1019,10 @@ public static Bitmap AnnotateImage(Bitmap bmp, string filePath, TaskSettings tas
form.CopyImageRequested += output => form.CopyImageRequested += output =>
{ {
Program.MainForm.InvokeSafe(() => ClipboardHelpers.CopyImage(output)); Program.MainForm.InvokeSafe(() =>
{
ClipboardHelpers.CopyImage(output);
});
}; };
form.UploadImageRequested += output => form.UploadImageRequested += output =>
@ -1061,11 +1064,11 @@ public static Bitmap AnnotateImage(Bitmap bmp, string filePath, TaskSettings tas
public static void OpenImageBeautifier() public static void OpenImageBeautifier()
{ {
Bitmap sourceImage = ImageHelpers.LoadImageWithFileDialog(); string filePath = ImageHelpers.OpenImageFileDialog();
if (sourceImage != null) if (!string.IsNullOrEmpty(filePath))
{ {
ImageBeautifierForm imageBeautifierForm = new ImageBeautifierForm(sourceImage); ImageBeautifierForm imageBeautifierForm = new ImageBeautifierForm(filePath, new ImageBeautifierOptions());
imageBeautifierForm.Show(); imageBeautifierForm.Show();
} }
} }