Hi,
I am working on a free hand drawing programme and as of now it is going very good. I need to add a tool through which user should draw line with rubber band effect. While drawing I am zooming the panel to 10x and allowing the user to draw. Normal drawing works perfect. But I dont know how to achieve the rubber band line drawing when the panel is zoomed.
In paint event I have this code:
Graphics gpsurf = e.Graphics;
//Here I zoom the image to 10x and make the pixel look square gpsurf.InterpolationMode = InterpolationMode.NearestNeighbor; gpsurf.ScaleTransform(zoom, zoom, MatrixOrder.Append); gpsurf.PixelOffsetMode = PixelOffsetMode.HighQuality;
//Here I do the drawing in bmp(bitmap) and display it gpsurf.DrawImage(bmp, posx, posy, bmp.Width, bmp.Height);
//Here I draw the line for rubber band effect gpsurf.DrawLine(drpen, x0 / zoom, y0 / zoom, x / zoom, y / zoom);
This code draws the line with rubber band when the drawing is finished with Mouse Up event. But the rubber band doesn't look like the crisp line drawn behind. Please somebody tell me how to draw the rubber band line also like the actual line with zoom.
Please please help............ I am stuck here...........