ToolArtworkRectangle.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. using PaintDotNet.Annotation.Enum;
  9. namespace PaintDotNet.Annotation.ImageCollect
  10. {
  11. public class ToolArtworkRectangle : ToolObject
  12. {
  13. private static Cursor cursor = new Cursor(PdnResources.GetResourceStream("Cursors.AnnotationRectangle.cur"));
  14. public static void CreateRectangle(ISurfaceBox drawArea, int id, Pen pen, Rectangle rect)
  15. {
  16. DrawArtworkRectangle rectangle = new DrawArtworkRectangle(drawArea, id, pen, rect);
  17. rectangle.ISurfaceBox = drawArea;
  18. AddNewObject(drawArea, rectangle);
  19. drawArea.ActiveTool = DrawToolType.Pointer;
  20. rectangle.Selected = true;
  21. }
  22. public static void OnMouseDown(ISurfaceBox drawArea, MouseEventArgs e)
  23. {
  24. //if (e.Button == MouseButtons.Left)
  25. //{
  26. // Point pointscroll = GetEventPointInArea(drawArea, e.Location);
  27. // DrawStitchingRectangle rectangle = new DrawStitchingRectangle(drawArea, pointscroll.X, pointscroll.Y, 1, 1);
  28. // rectangle.ISurfaceBox = drawArea;
  29. // AddNewObject(drawArea, rectangle);
  30. //}
  31. }
  32. public static void OnMouseMove(ISurfaceBox drawArea, MouseEventArgs e)
  33. {
  34. //Point pointscroll = GetEventPointInArea(drawArea, e.Location);
  35. ////drawArea.Cursor = Cursor;
  36. //if (e.Button == MouseButtons.Left)
  37. //{
  38. // drawArea.GraphicsList[0].MoveHandleTo(pointscroll, 5);
  39. // drawArea.Refresh();
  40. // drawArea.GraphicsList.Dirty = true;
  41. //}
  42. }
  43. public static void OnMouseUp(ISurfaceBox drawArea, MouseEventArgs e)
  44. {
  45. //if (e.Button == MouseButtons.Left)
  46. //{
  47. // if (!drawArea.ContinuousDrawingLabel())
  48. // {
  49. // drawArea.ActiveTool = DrawToolType.Pointer;
  50. // }
  51. // OnMouseUpTwo(drawArea, e);
  52. //}
  53. }
  54. public static void OnMouseClick(ISurfaceBox surfacebox, MouseEventArgs e)
  55. {
  56. }
  57. /// <summary>
  58. /// 鼠标左键双击
  59. /// </summary>
  60. /// <param name="drawArea"></param>
  61. /// <param name="e"></param>
  62. public static void OnMouseLeftDoubleClick(ISurfaceBox surfacebox, MouseEventArgs e)
  63. {
  64. Console.WriteLine("鼠标左键双击");
  65. }
  66. /// <summary>
  67. /// 删除按键
  68. /// </summary>
  69. /// <param name="surfacebox"></param>
  70. /// <param name="e"></param>
  71. public static void OnDelKeyDown(ISurfaceBox surfacebox, MouseEventArgs e)
  72. {
  73. }
  74. /// <summary>
  75. /// 删除划痕处理&污迹处理选择区域的痕迹
  76. /// </summary>
  77. /// <param name="surfacebox"></param>
  78. /// <param name="e"></param>
  79. public static void OnDel2KeyDown(ISurfaceBox surfacebox, MouseEventArgs e)
  80. {
  81. }
  82. public static void beginWithNewObject()
  83. {
  84. }
  85. }
  86. }