mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-28 23:42:13 +12:00
Added image effect option summary near effect names
This commit is contained in:
parent
34b4e068cc
commit
08a00c1696
43 changed files with 348 additions and 41 deletions
|
@ -522,10 +522,8 @@ public static Bitmap DrawBackgroundImage(Bitmap bmp, Bitmap backgroundImage, boo
|
|||
|
||||
if (tile)
|
||||
{
|
||||
using (TextureBrush brush = new TextureBrush(backgroundImage))
|
||||
using (TextureBrush brush = new TextureBrush(backgroundImage, WrapMode.Tile))
|
||||
{
|
||||
brush.WrapMode = WrapMode.Tile;
|
||||
|
||||
if (center)
|
||||
{
|
||||
int tileX = (bmpResult.Width - backgroundImage.Width) / 2 % backgroundImage.Width;
|
||||
|
|
|
@ -49,5 +49,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Alpha(Value, Addition).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Value}, {Addition}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Brightness(Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -50,5 +50,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Colorize(Color, Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Color.R}, {Color.G}, {Color.B}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Contrast(Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.ChangeGamma(bmp, Value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Grayscale(Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Hue(Angle).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Angle + "°";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Saturation(Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,5 +46,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ColorMatrixManager.Sepia(Value).Apply(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,5 +69,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ImageHelpers.FillBackground(bmp, Color);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!UseGradient)
|
||||
{
|
||||
return $"{Color.R}, {Color.G}, {Color.B}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,5 +51,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.DrawBackgroundImage(bmp, ImageFilePath, Center, Tile);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ImageFilePath))
|
||||
{
|
||||
return FileHelpers.GetFileNameSafe(ImageFilePath);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -88,5 +88,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return ImageHelpers.DrawBorder(bmp, Color, Size, Type, DashStyle);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size + "px";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -63,5 +63,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.DrawCheckers(bmp, Size, Color, Color2);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Size}x{Size}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -174,5 +174,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ImageLocation))
|
||||
{
|
||||
return FileHelpers.GetFileNameSafe(ImageLocation);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -220,5 +220,15 @@ private void DrawImage(Image img, Image img2, Graphics g)
|
|||
|
||||
g.PixelOffsetMode = PixelOffsetMode.Default;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ImageFolder))
|
||||
{
|
||||
return FileHelpers.GetFileNameSafe(ImageFolder);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -240,5 +240,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Text))
|
||||
{
|
||||
return Text.Truncate(20, "...");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -298,5 +298,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return bmp;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Text))
|
||||
{
|
||||
return Text.Truncate(20, "...");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,5 +61,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
ImageHelpers.ApplyBoxBlur(bmp, Radius);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Radius.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,5 +57,17 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
ImageHelpers.ColorDepth(bmp, BitsPerChannel);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
string summary = BitsPerChannel + " bit";
|
||||
|
||||
if (BitsPerChannel > 1)
|
||||
{
|
||||
summary += "s";
|
||||
}
|
||||
|
||||
return summary;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -83,5 +83,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return kernelVert.Apply(horizPass);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -110,5 +110,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.AddGlow(bmp, Size, Strength, Color, Offset, UseGradient ? Gradient : null);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -77,5 +77,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.Outline(bmp, Size, Color, Padding, OutlineOnly);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -75,5 +75,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
ImageHelpers.Pixelate(bmp, Size, BorderSize, BorderColor);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -94,5 +94,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.DrawReflection(bmp, Percentage, MaxAlpha, MinAlpha, Offset, Skew, SkewSize);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Percentage.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -83,5 +83,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.AddShadow(bmp, Opacity, Size, Darkness + 1, Color, Offset, AutoResize);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Size.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -86,5 +86,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ImageHelpers.Slice(bmp, minSliceHeight, maxSliceHeight, minSliceShift, maxSliceShift);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{MinSliceHeight}, {MaxSliceHeight}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,5 +54,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.TornEdges(bmp, Depth, Range, Sides, CurvedEdges, true);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Depth}, {Range}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,5 +51,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.WavyEdges(bmp, Depth, Range, Sides);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Depth}, {Range}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -335,6 +335,30 @@ private void UpdateControlStates()
|
|||
btnEffectRemove.Enabled = btnEffectDuplicate.Enabled = lvEffects.SelectedItems.Count > 0;
|
||||
}
|
||||
|
||||
private void UpdateEffectName()
|
||||
{
|
||||
ImageEffectPreset preset = GetSelectedPreset();
|
||||
|
||||
if (preset != null)
|
||||
{
|
||||
if (lvEffects.SelectedItems.Count > 0)
|
||||
{
|
||||
ListViewItem lvi = lvEffects.SelectedItems[0];
|
||||
|
||||
if (lvi.Tag is ImageEffect imageEffect)
|
||||
{
|
||||
string text = imageEffect.ToString();
|
||||
|
||||
if (lvi.Text != text)
|
||||
{
|
||||
lvi.Text = text;
|
||||
txtEffectName.SetWatermark(imageEffect.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GeneratePreviewImage(int padding)
|
||||
{
|
||||
if (pbResult.ClientSize.Width > 0 && pbResult.ClientSize.Height > 0)
|
||||
|
@ -680,7 +704,7 @@ private void lvEffects_SelectedIndexChanged(object sender, EventArgs e)
|
|||
if (lvi.Tag is ImageEffect imageEffect)
|
||||
{
|
||||
txtEffectName.Text = imageEffect.Name;
|
||||
txtEffectName.SetWatermark(imageEffect.GetType().GetDescription());
|
||||
txtEffectName.SetWatermark(imageEffect.ToString());
|
||||
pgSettings.SelectedObject = imageEffect;
|
||||
}
|
||||
}
|
||||
|
@ -714,6 +738,7 @@ private void lvEffects_KeyDown(object sender, KeyEventArgs e)
|
|||
|
||||
private void pgSettings_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||
{
|
||||
UpdateEffectName();
|
||||
UpdatePreview();
|
||||
}
|
||||
|
||||
|
|
|
@ -171,6 +171,15 @@
|
|||
<metadata name="cmsLoadImage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>126, 17</value>
|
||||
</metadata>
|
||||
<data name="cmsLoadImage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>131, 48</value>
|
||||
</data>
|
||||
<data name=">>cmsLoadImage.Name" xml:space="preserve">
|
||||
<value>cmsLoadImage</value>
|
||||
</data>
|
||||
<data name=">>cmsLoadImage.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="tsmiLoadImageFromFile.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>130, 22</value>
|
||||
</data>
|
||||
|
@ -183,15 +192,6 @@
|
|||
<data name="tsmiLoadImageFromClipboard.Text" xml:space="preserve">
|
||||
<value>From clipboard</value>
|
||||
</data>
|
||||
<data name="cmsLoadImage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>131, 48</value>
|
||||
</data>
|
||||
<data name=">>cmsLoadImage.Name" xml:space="preserve">
|
||||
<value>cmsLoadImage</value>
|
||||
</data>
|
||||
<data name=">>cmsLoadImage.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="lblPresetName.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
|
@ -226,7 +226,7 @@
|
|||
<value>184, 24</value>
|
||||
</data>
|
||||
<data name="txtPresetName.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>144, 20</value>
|
||||
<value>192, 20</value>
|
||||
</data>
|
||||
<data name="txtPresetName.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
|
@ -250,7 +250,7 @@
|
|||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>960, 552</value>
|
||||
<value>1096, 552</value>
|
||||
</data>
|
||||
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>120, 24</value>
|
||||
|
@ -280,7 +280,7 @@
|
|||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>832, 552</value>
|
||||
<value>968, 552</value>
|
||||
</data>
|
||||
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>120, 24</value>
|
||||
|
@ -399,6 +399,9 @@
|
|||
<data name=">>btnPackager.ZOrder" xml:space="preserve">
|
||||
<value>17</value>
|
||||
</data>
|
||||
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>260, 17</value>
|
||||
</metadata>
|
||||
<data name="btnPresetNew.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
|
@ -411,9 +414,6 @@
|
|||
<data name="btnPresetNew.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>260, 17</value>
|
||||
</metadata>
|
||||
<data name="btnPresetNew.ToolTip" xml:space="preserve">
|
||||
<value>New</value>
|
||||
</data>
|
||||
|
@ -648,6 +648,9 @@
|
|||
<data name=">>btnEffectRefresh.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>260, 17</value>
|
||||
</metadata>
|
||||
<data name="pgSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
</data>
|
||||
|
@ -655,7 +658,7 @@
|
|||
<value>False</value>
|
||||
</data>
|
||||
<data name="pgSettings.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>336, 56</value>
|
||||
<value>384, 56</value>
|
||||
</data>
|
||||
<data name="pgSettings.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>288, 488</value>
|
||||
|
@ -712,7 +715,7 @@
|
|||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="lblEffectName.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>333, 8</value>
|
||||
<value>381, 8</value>
|
||||
</data>
|
||||
<data name="lblEffectName.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>67, 13</value>
|
||||
|
@ -736,7 +739,7 @@
|
|||
<value>3</value>
|
||||
</data>
|
||||
<data name="txtEffectName.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>336, 24</value>
|
||||
<value>384, 24</value>
|
||||
</data>
|
||||
<data name="txtEffectName.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>288, 20</value>
|
||||
|
@ -760,10 +763,10 @@
|
|||
<value>Top, Bottom, Left, Right</value>
|
||||
</data>
|
||||
<data name="pbResult.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>632, 8</value>
|
||||
<value>680, 8</value>
|
||||
</data>
|
||||
<data name="pbResult.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>450, 536</value>
|
||||
<value>536, 536</value>
|
||||
</data>
|
||||
<data name="pbResult.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>19</value>
|
||||
|
@ -772,7 +775,7 @@
|
|||
<value>pbResult</value>
|
||||
</data>
|
||||
<data name=">>pbResult.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>pbResult.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
@ -783,9 +786,6 @@
|
|||
<data name="lvPresets.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
</data>
|
||||
<data name="chPreset.Width" type="System.Int32, mscorlib">
|
||||
<value>164</value>
|
||||
</data>
|
||||
<data name="lvPresets.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>8, 53</value>
|
||||
</data>
|
||||
|
@ -799,7 +799,7 @@
|
|||
<value>lvPresets</value>
|
||||
</data>
|
||||
<data name=">>lvPresets.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>lvPresets.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
@ -807,6 +807,9 @@
|
|||
<data name=">>lvPresets.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name="chPreset.Width" type="System.Int32, mscorlib">
|
||||
<value>164</value>
|
||||
</data>
|
||||
<data name="mbLoadImage.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
</data>
|
||||
|
@ -832,7 +835,7 @@
|
|||
<value>mbLoadImage</value>
|
||||
</data>
|
||||
<data name=">>mbLoadImage.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>mbLoadImage.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
@ -843,14 +846,11 @@
|
|||
<data name="lvEffects.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
</data>
|
||||
<data name="chEffect.Width" type="System.Int32, mscorlib">
|
||||
<value>50</value>
|
||||
</data>
|
||||
<data name="lvEffects.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>184, 101</value>
|
||||
</data>
|
||||
<data name="lvEffects.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>144, 443</value>
|
||||
<value>192, 443</value>
|
||||
</data>
|
||||
<data name="lvEffects.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>15</value>
|
||||
|
@ -859,7 +859,7 @@
|
|||
<value>lvEffects</value>
|
||||
</data>
|
||||
<data name=">>lvEffects.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>lvEffects.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
@ -867,6 +867,9 @@
|
|||
<data name=">>lvEffects.ZOrder" xml:space="preserve">
|
||||
<value>26</value>
|
||||
</data>
|
||||
<data name="chEffect.Width" type="System.Int32, mscorlib">
|
||||
<value>50</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -877,10 +880,7 @@
|
|||
<value>96, 96</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>1089, 585</value>
|
||||
</data>
|
||||
<data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
<value>1224, 585</value>
|
||||
</data>
|
||||
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>600, 400</value>
|
||||
|
|
|
@ -46,6 +46,11 @@ protected ImageEffect()
|
|||
|
||||
public abstract Bitmap Apply(Bitmap bmp);
|
||||
|
||||
protected virtual string GetSummary()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Name))
|
||||
|
@ -53,7 +58,15 @@ public override string ToString()
|
|||
return Name;
|
||||
}
|
||||
|
||||
return GetType().GetDescription();
|
||||
string name = GetType().GetDescription();
|
||||
string summary = GetSummary();
|
||||
|
||||
if (!string.IsNullOrEmpty(summary))
|
||||
{
|
||||
name = $"{name}: {summary}";
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,5 +48,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.AutoCropImage(bmp, true, Sides, Padding);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (Padding > 0)
|
||||
{
|
||||
return Padding.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -81,5 +81,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
bmp.Dispose();
|
||||
return bmpResult;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (Margin.All == -1)
|
||||
{
|
||||
return $"{Margin.Left}, {Margin.Top}, {Margin.Right}, {Margin.Bottom}";
|
||||
}
|
||||
|
||||
return Margin.All.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -61,5 +61,15 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return ImageHelpers.CropBitmap(bmp, new Rectangle(Margin.Left, Margin.Top, bmp.Width - Margin.Horizontal, bmp.Height - Margin.Vertical));
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
if (Margin.All == -1)
|
||||
{
|
||||
return $"{Margin.Left}, {Margin.Top}, {Margin.Right}, {Margin.Bottom}";
|
||||
}
|
||||
|
||||
return Margin.All.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -66,5 +66,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Horizontally}, {Vertically}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -119,5 +119,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{ProportionalWidth}, {ProportionalHeight}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,5 +68,24 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return ImageHelpers.ResizeImage(bmp, size);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
string summary = Width.ToString();
|
||||
|
||||
if (Width > 0)
|
||||
{
|
||||
summary += "px";
|
||||
}
|
||||
|
||||
summary += ", " + Height.ToString();
|
||||
|
||||
if (Height > 0)
|
||||
{
|
||||
summary += "px";
|
||||
}
|
||||
|
||||
return summary;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,5 +57,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
return ImageHelpers.RotateImage(bmp, Angle, Upsize, Clip);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return Angle + "°";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,5 +56,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
{
|
||||
return ImageHelpers.RoundedCorners(bmp, CornerRadius);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return CornerRadius.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,5 +56,24 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return ImageHelpers.ResizeImage(bmp, size);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
string summary = WidthPercentage.ToString();
|
||||
|
||||
if (WidthPercentage > 0)
|
||||
{
|
||||
summary += "%";
|
||||
}
|
||||
|
||||
summary += ", " + HeightPercentage.ToString();
|
||||
|
||||
if (HeightPercentage > 0)
|
||||
{
|
||||
summary += "%";
|
||||
}
|
||||
|
||||
return summary;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,5 +51,10 @@ public override Bitmap Apply(Bitmap bmp)
|
|||
|
||||
return ImageHelpers.AddSkew(bmp, Horizontally, Vertically);
|
||||
}
|
||||
|
||||
protected override string GetSummary()
|
||||
{
|
||||
return $"{Horizontally}px, {Vertically}px";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
using ShareX.HelpersLib;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
|
@ -135,7 +136,7 @@ public override void OnUpdate()
|
|||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
using (Image selectionHighlightPattern = ImageHelpers.CreateCheckerPattern(1, 1, Color.FromArgb(128, Color.LightGray), Color.FromArgb(128, Color.Gray)))
|
||||
using (Brush selectionHighlightBrush = new TextureBrush(selectionHighlightPattern, System.Drawing.Drawing2D.WrapMode.Tile))
|
||||
using (Brush selectionHighlightBrush = new TextureBrush(selectionHighlightPattern, WrapMode.Tile))
|
||||
{
|
||||
g.FillRectangle(selectionHighlightBrush, CutOutRectangle);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue