am using GraphicsPath
to draw Lines
so it's like Pen/Brush
tool in Paint
public void OnMouseDown(object sender, MouseEventArgs e)
{
start = e.Location;
path.AddLine(e.Location, new Point(e.Location.X, e.Location.Y));
}
public void OnMouseMove(object sender, MouseEventArgs e)
{
end = e.Location;
path.AddLine(e.Location, new Point(e.Location.X, e.Location.Y));
}
public void OnMouseUp(object sender, MouseEventArgs e)
{
end = e.Location;
path.AddLine(e.Location, new Point(e.Location.X, e.Location.Y));
}
public void OnPaint(object sender, Graphics g)
{
g.DrawPath(pen, path);
}
how would I Relocate
it , I have tried Transform
method , but it didn't work..
public void Relocate(MouseEventArgs e)
{
Matrix m = new Matrix();
m.Translate(start.X + e.X - end.X, start.Y + e.Y - end.Y, MatrixOrder.Append);
path.Transform(m);
}
so how would I do it the right way? moving the whole drawn shape?