ToolAutoRuler.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using PaintDotNet.Annotation.Enum;
  2. using System;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. namespace PaintDotNet.Annotation.Label
  6. {
  7. /// <summary>
  8. /// 标注->自动标尺
  9. /// </summary>
  10. public class ToolAutoRuler : ToolObject
  11. {
  12. public static void OnMouseDown(ISurfaceBox drawArea, MouseEventArgs e)
  13. {
  14. //if (drawArea.GetGainMultiple() == 0)
  15. //{
  16. // MessageBox.Show("请先设置放大倍数");
  17. // return;
  18. //}
  19. //else
  20. //{
  21. //DrawAutoRuler newAutoRuler = new DrawAutoRuler(drawArea);
  22. //newAutoRuler.ISurfaceBox = drawArea;
  23. //AddNewObject(drawArea, newAutoRuler);
  24. //OnMouseUpTwo(drawArea, e);
  25. //drawArea.Refresh();
  26. //}
  27. }
  28. public static void OnMouseMove(ISurfaceBox drawArea, MouseEventArgs e)
  29. {
  30. }
  31. public static void OnMouseUp(ISurfaceBox drawArea, MouseEventArgs e)
  32. {
  33. if (e.Button == MouseButtons.Left)
  34. {
  35. if (!drawArea.ContinuousDrawingLabel())
  36. {
  37. drawArea.ActiveTool = DrawToolType.Pointer;
  38. }
  39. }
  40. }
  41. public static void OnMouseClick(ISurfaceBox drawArea, MouseEventArgs e)
  42. {
  43. }
  44. public static void beginWithNewObject()
  45. {
  46. }
  47. public static void addWithNewObject(ISurfaceBox drawArea)
  48. {
  49. DrawAutoRuler newAutoRuler = new DrawAutoRuler(drawArea);
  50. newAutoRuler.ISurfaceBox = drawArea;
  51. AddNewObject(drawArea, newAutoRuler);
  52. OnMouseUpTwo(drawArea,null);
  53. drawArea.Refresh();
  54. }
  55. }
  56. }