mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Added custom circle resize node
This commit is contained in:
parent
03a78c8a0c
commit
4ee76af0ea
10 changed files with 24 additions and 8 deletions
|
@ -84,7 +84,7 @@ internal enum NodePosition
|
||||||
|
|
||||||
internal enum NodeShape
|
internal enum NodeShape
|
||||||
{
|
{
|
||||||
Square, Circle, Diamond
|
Square, Circle, Diamond, CustomNode
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum FFmpegVideoCodec
|
public enum FFmpegVideoCodec
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace ShareX.ScreenCaptureLib.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", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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 {
|
||||||
|
@ -99,6 +99,16 @@ internal static System.Drawing.Bitmap camera {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap CircleNode {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("CircleNode", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -609,4 +609,7 @@ Distance: {6:0.00} px / Angle: {7:0.00}°</value>
|
||||||
<data name="cursor" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="cursor" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\cursor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\cursor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="CircleNode" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\CircleNode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
||||||
#endregion License Information (GPL v3)
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
using ShareX.HelpersLib;
|
using ShareX.HelpersLib;
|
||||||
|
using ShareX.ScreenCaptureLib.Properties;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace ShareX.ScreenCaptureLib
|
namespace ShareX.ScreenCaptureLib
|
||||||
|
@ -52,11 +53,13 @@ public Point Position
|
||||||
|
|
||||||
public NodeShape Shape { get; set; }
|
public NodeShape Shape { get; set; }
|
||||||
|
|
||||||
|
private static Image customNodeImage = Resources.CircleNode;
|
||||||
|
|
||||||
public ResizeNode(int x = 0, int y = 0)
|
public ResizeNode(int x = 0, int y = 0)
|
||||||
{
|
{
|
||||||
Size = DefaultSize;
|
Shape = NodeShape.CustomNode;
|
||||||
Shape = NodeShape.Square;
|
|
||||||
Position = new Point(x, y);
|
Position = new Point(x, y);
|
||||||
|
Size = customNodeImage.Width;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(Graphics g)
|
public override void Draw(Graphics g)
|
||||||
|
@ -77,6 +80,9 @@ public override void Draw(Graphics g)
|
||||||
g.DrawDiamond(Pens.White, rect.Offset(-1));
|
g.DrawDiamond(Pens.White, rect.Offset(-1));
|
||||||
g.DrawDiamond(Pens.Black, rect);
|
g.DrawDiamond(Pens.Black, rect);
|
||||||
break;
|
break;
|
||||||
|
case NodeShape.CustomNode:
|
||||||
|
g.DrawImage(customNodeImage, Rectangle);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
ShareX.ScreenCaptureLib/Resources/CircleNode.png
Normal file
BIN
ShareX.ScreenCaptureLib/Resources/CircleNode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -214,7 +214,6 @@ public virtual void OnNodeVisible()
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
ResizeNode node = Manager.ResizeNodes[i];
|
ResizeNode node = Manager.ResizeNodes[i];
|
||||||
node.Shape = NodeShape.Square;
|
|
||||||
node.Visible = true;
|
node.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,6 @@ public override void OnNodeVisible()
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
ResizeNode node = Manager.ResizeNodes[i];
|
ResizeNode node = Manager.ResizeNodes[i];
|
||||||
node.Shape = NodeShape.Circle;
|
|
||||||
node.Visible = false;
|
node.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ public override void OnNodeVisible()
|
||||||
base.OnNodeVisible();
|
base.OnNodeVisible();
|
||||||
|
|
||||||
TailNode.Position = TailPosition;
|
TailNode.Position = TailPosition;
|
||||||
TailNode.Shape = NodeShape.Circle;
|
|
||||||
TailNode.Visible = true;
|
TailNode.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,6 @@ public override void Resize(int x, int y, bool fromBottomRight)
|
||||||
|
|
||||||
public override void OnNodeVisible()
|
public override void OnNodeVisible()
|
||||||
{
|
{
|
||||||
Manager.ResizeNodes[(int)NodePosition.TopLeft].Shape = NodeShape.Circle;
|
|
||||||
Manager.ResizeNodes[(int)NodePosition.TopLeft].Visible = true;
|
Manager.ResizeNodes[(int)NodePosition.TopLeft].Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,6 +248,7 @@
|
||||||
<None Include="Resources\camera.png" />
|
<None Include="Resources\camera.png" />
|
||||||
<None Include="Resources\control.png" />
|
<None Include="Resources\control.png" />
|
||||||
<None Include="Resources\cross.png" />
|
<None Include="Resources\cross.png" />
|
||||||
|
<None Include="Resources\CircleNode.png" />
|
||||||
<Content Include="Resources\Crosshair.cur" />
|
<Content Include="Resources\Crosshair.cur" />
|
||||||
<None Include="Resources\exclamation-button.png" />
|
<None Include="Resources\exclamation-button.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue