paint type program's canvas

  • Thread starter Thread starter billy
  • Start date Start date
B

billy

I'm working on a sort of paint program that has the usual canvas pane in the
middle of the main form. I'm working on that class and have a couple quick
questions.. actually more like I'm looking for opinions.

1) I want a ruler running along from top left to top right and from top left
to bottom left. I want to use a skinny UserControl or something that runs
the respective length. I could simply track the mouse and draw the little
line on it. Is there a better control to use?

2) There are a few different ways to render the actual images themselves
(this app will allow the images to be modified while on the canvas) but does
anyone here have any experience going through the effort of using one method
over the other? I could use regular drawing APIs since the real cpu
intensive work here isn't just displaying but rendering the changes to a
buffer and then displaying it. I could use System.Drawing (which is based on
GDI+ I think) or DirectX or ?

Thanks for any help on this. There are obvious ways to do these things but
I'm wondering if there are any absolute correct ways, specifically on the
canvas drawing. Thanks again for any input,

~billy
 
2) There are a few different ways to render the actual images themselves
(this app will allow the images to be modified while on the canvas) but
does
anyone here have any experience going through the effort of using one
method
over the other? I could use regular drawing APIs since the real cpu
intensive work here isn't just displaying but rendering the changes to a
buffer and then displaying it. I could use System.Drawing (which is based
on
GDI+ I think) or DirectX or ?

If at all possible, use Graphics.DrawImage to actually fill up your canvas.
Not only is it fast, but it remains fast even when asking it to
resize/rescale the image as you'll probably want to do in a paint program.
The managed GDI wrapper classes make this sort of thing pretty darned easy,
too, which is nice.
 
Back
Top