实现画图的基本工具,可以拖动句柄,实现修改,实现图层的叠加,using System;using System.Windows.Forms;using System.Drawing;namespace DrawTools{/// <summary>/// Base class for all drawing tools/// </summary>public abstract class Tool{ /// <summary> /// Left nous button is pressed /// </summary> /// <param name="drawArea"></param> /// <param name="e"></param> public virtual void OnMouseDown(DrawArea drawArea, MouseEventArgs e) { } /// <summary> /// Mouse is moved, left mouse button is pressed or none button is pressed /// </summary> /// <param name="drawArea"></param> /// <param name="e"></param> public virtual void OnMouseMove(DrawArea drawArea, MouseEventArgs e) { } /// <summary> /// Left mouse button is released /// </summary> /// <param name="drawArea"></param> /// <param name="e"></param> public virtual void OnMouseUp(DrawArea drawArea, MouseEventArgs e) { } }}
评论