|
/* --------------------------------------------------------------------------------------------------------------
* I Software Innovations
* --------------------------------------------------------------------------------------------------------------
* SVG Artieste 2.0
* --------------------------------------------------------------------------------------------------------------
* File : ToolRectangle.cs
* Author : ajaysbritto@yahoo.com
* Date : 20/03/2010
* --------------------------------------------------------------------------------------------------------------
* Change Log
* --------------------------------------------------------------------------------------------------------------
* Author Comments
*/
using System.Windows.Forms;
using System.Drawing;
using Draw;
using System.Reflection;
namespace DrawTools
{
/// <summary>
/// Rectangle tool
/// </summary>
public class ToolRectangle : ToolObject
{
public ToolRectangle()
{
Cursor = new Cursor(Assembly.GetExecutingAssembly().GetManifestResourceStream("SVGEditor2.Resources.Rectangle.cur"));
}
public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e)
{
AddNewObject(drawArea, new DrawRectangle(e.X, e.Y, 1, 1));
}
public override void OnMouseMove(DrawArea drawArea, MouseEventArgs e)
{
drawArea.Cursor = Cursor;
if (e.Button == MouseButtons.Left && drawArea.GraphicsList.Count > 0)
{
var point = new Point(e.X, e.Y);
drawArea.GraphicsList[0].MoveHandleTo(point, 5);
drawArea.Refresh();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
He is a Microsoft technology enthusiast, who wish to create applications which others find useful.He loves making small tools and getting involved in architecting bigger systems.
He is currently working as a professional developer in a software development firm in .Net technologies.
He likes reading technical blogs, contributing to opensource and most importantly, enjoying life.
His ambition is to be an impressive software maker.