using PaintDotNet.Annotation.Enum;
using System.Drawing;
using System.Windows.Forms;
namespace PaintDotNet.Annotation.Label
{
///
/// 标注->曲线->铅笔
///
public class ToolPencil : ToolObject
{
private static Cursor cursor = new Cursor(PdnResources.GetResourceStream("Cursors.AnnotationPencil.cur"));
private static DrawPencil newPolygon;
///
/// Left nouse button is pressed
///
///
///
public static void OnMouseDown(ISurfaceBox drawArea, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point p = GetEventPointInArea(drawArea, e.Location);
// Create new polygon, add it to the list
// and keep reference to it
newPolygon = new DrawPencil(drawArea, p.X, p.Y);
newPolygon.ISurfaceBox = drawArea;
AddNewObject(drawArea, newPolygon);
}
else {
OnMouseNotLeftDown(drawArea, null);
}
}
///
/// Mouse move - resize new polygon
///
///
///
public static void OnMouseMove(ISurfaceBox drawArea, MouseEventArgs e)
{
Point p = GetEventPointInArea(drawArea, e.Location);
drawArea.Cursor = cursor;
if (e.Button != MouseButtons.Left)
return;
if (newPolygon == null)
return; // precaution
Point point = new Point(p.X, p.Y);
newPolygon.AddPoint(point);
drawArea.GraphicsList.Dirty = true;
drawArea.Refresh();
}
public static void OnMouseUp(ISurfaceBox drawArea, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (!drawArea.ContinuousDrawingLabel())
{
newPolygon = null;
OnMouseUpTwo(drawArea, e);
drawArea.ActiveTool = DrawToolType.Pointer;
}
}
}
public static void OnMouseClick(ISurfaceBox surfacebox, MouseEventArgs e)
{
}
///
/// 鼠标左键双击
///
///
///
public static void OnMouseLeftDoubleClick(ISurfaceBox surfacebox, MouseEventArgs e)
{
}
///
/// 删除按键
///
///
///
public static void OnDelKeyDown(ISurfaceBox surfacebox, MouseEventArgs e)
{
}
///
/// 删除划痕处理&污迹处理选择区域的痕迹
///
///
///
public static void OnDel2KeyDown(ISurfaceBox surfacebox, MouseEventArgs e)
{
}
public static void beginWithNewObject()
{
}
}
}