using PaintDotNet.Annotation.Enum; using System; using System.Drawing; using System.Windows.Forms; namespace PaintDotNet.Annotation.Label { /// /// 标注->自动标尺 /// 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(); } } }