123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using PaintDotNet.Annotation.Enum;
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- namespace PaintDotNet.Annotation.Label
- {
- /// <summary>
- /// 标注->自动标尺
- /// </summary>
- public class ToolAutoRuler : ToolObject
- {
- public static void OnMouseDown(ISurfaceBox drawArea, MouseEventArgs e)
- {
- //if (drawArea.GetGainMultiple() == 0)
- //{
- // MessageBox.Show("请先设置放大倍数");
- // return;
- //}
- //else
- //{
- //DrawAutoRuler newAutoRuler = new DrawAutoRuler(drawArea);
- //newAutoRuler.ISurfaceBox = drawArea;
- //AddNewObject(drawArea, newAutoRuler);
- //OnMouseUpTwo(drawArea, e);
- //drawArea.Refresh();
- //}
- }
- public static void OnMouseMove(ISurfaceBox drawArea, MouseEventArgs e)
- {
-
- }
- public static void OnMouseUp(ISurfaceBox drawArea, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- if (!drawArea.ContinuousDrawingLabel())
- {
- drawArea.ActiveTool = DrawToolType.Pointer;
- }
- }
- }
-
- public static void OnMouseClick(ISurfaceBox drawArea, MouseEventArgs e)
- {
- }
- public static void beginWithNewObject()
- {
- }
- public static void addWithNewObject(ISurfaceBox drawArea)
- {
- DrawAutoRuler newAutoRuler = new DrawAutoRuler(drawArea);
- newAutoRuler.ISurfaceBox = drawArea;
- AddNewObject(drawArea, newAutoRuler);
- OnMouseUpTwo(drawArea,null);
- drawArea.Refresh();
- }
- }
- }
-
|