I found this nifty piece of code online that lets me draw on a form.
protected override void OnMouseMove(MouseEventArgs e)
{
g = CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
p = new Pen(Color.Black);
if (lastPoint.Equals(Point.Empty)) lastPoint = new Point(e.X, e.Y);
if (mouseDown)
{ Point pMousePos = new Point(e.X, e.Y);
g.DrawLine(p, pMousePos, lastPoint);
}
lastPoint = new Point(e.X, e.Y);
}
This lets me easily draw on the form by clicking the left mouse buttong and dragging it around. Similar to what you see when using a pencil tool in paint. I'm curious how I would load an image, draw on it and then save it.
I found this piece of code to load and image but haven't been able to get it to work with the above code.
Bitmap myBitmap = new Bitmap(@"C:\Documents and
Settings\Joe\Pics\myPic.bmp");
Graphics g = Graphics.FromImage(myBitmap);
Any nudge in the right direction would be a great help.
Thanks in advance.