mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
fixed #2660: Added "Add image effects" button to image editor menu
This commit is contained in:
parent
afa273d884
commit
b9387701cf
6 changed files with 49 additions and 0 deletions
|
@ -523,6 +523,16 @@ internal static System.Drawing.Bitmap image_resize_actual {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap image_saturation {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("image_saturation", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
|
|
@ -729,4 +729,7 @@ Distance: {6:0.00} px / Angle: {7:0.00}°</value>
|
|||
<data name="ShapeManager_CreateToolbar_InterpolationMode" xml:space="preserve">
|
||||
<value>Interpolation mode</value>
|
||||
</data>
|
||||
<data name="image_saturation" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\image-saturation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
ShareX.ScreenCaptureLib/Resources/image-saturation.png
Normal file
BIN
ShareX.ScreenCaptureLib/Resources/image-saturation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib;
|
||||
using ShareX.ImageEffectsLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
@ -1697,6 +1698,29 @@ private void RotateImage(RotateFlipType type)
|
|||
UpdateCanvas(img);
|
||||
}
|
||||
|
||||
private void AddImageEffects()
|
||||
{
|
||||
Form.Pause();
|
||||
|
||||
using (ImageEffectsForm imageEffectsForm = new ImageEffectsForm(Form.Canvas, new List<ImageEffectPreset>() { new ImageEffectPreset() }, 0))
|
||||
{
|
||||
imageEffectsForm.ShowDialog(Form);
|
||||
|
||||
if (imageEffectsForm.Presets.IsValidIndex(imageEffectsForm.SelectedPresetIndex))
|
||||
{
|
||||
ImageEffectPreset preset = imageEffectsForm.Presets[imageEffectsForm.SelectedPresetIndex];
|
||||
Image img = preset.ApplyEffects(Form.Canvas);
|
||||
|
||||
if (img != null)
|
||||
{
|
||||
UpdateCanvas(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form.Resume();
|
||||
}
|
||||
|
||||
private void OnCurrentShapeChanged(BaseShape shape)
|
||||
{
|
||||
if (CurrentShapeChanged != null)
|
||||
|
|
|
@ -711,6 +711,13 @@ internal void CreateToolbar()
|
|||
tsmiFlipVertical.Click += (sender, e) => RotateImage(RotateFlipType.RotateNoneFlipY);
|
||||
tsddbImage.DropDownItems.Add(tsmiFlipVertical);
|
||||
|
||||
tsddbImage.DropDownItems.Add(new ToolStripSeparator());
|
||||
|
||||
ToolStripMenuItem tsmiAddImageEffects = new ToolStripMenuItem("Add image effects...");
|
||||
tsmiAddImageEffects.Image = Resources.image_saturation;
|
||||
tsmiAddImageEffects.Click += (sender, e) => AddImageEffects();
|
||||
tsddbImage.DropDownItems.Add(tsmiAddImageEffects);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
|
@ -213,12 +213,17 @@
|
|||
<Project>{327750E1-9FB7-4CC3-8AEA-9BC42180CAD3}</Project>
|
||||
<Name>ShareX.HelpersLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ShareX.ImageEffectsLib\ShareX.ImageEffectsLib.csproj">
|
||||
<Project>{d13441b6-96e1-4d1b-8a95-58a7d6cb1e24}</Project>
|
||||
<Name>ShareX.ImageEffectsLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ShareX.MediaLib\ShareX.MediaLib.csproj">
|
||||
<Project>{1a190e53-1419-4cc2-b0e5-3bc7ea861c8b}</Project>
|
||||
<Name>ShareX.MediaLib</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\image-saturation.png" />
|
||||
<None Include="Resources\image-select.png" />
|
||||
<None Include="Resources\image-empty.png" />
|
||||
<None Include="Resources\image--plus.png" />
|
||||
|
|
Loading…
Reference in a new issue