Groups | Blog | Home
all groups > c# > february 2005 >

c# : creating drawing canvas with ruler


billy
2/18/2005 10:34:29 PM
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

billy
2/19/2005 6:07:37 AM
Wow, what an awesome control. That does exactly what I need it to. Is there
any licensing fee? This application is really something I'm doing at home to
get myself into c# and will probably never see the light of day. Thanks for
the article regardless. Bye,

~billy

[quoted text, click to view]

NeoNet
2/19/2005 10:33:04 AM
"billy" <billy_dev@_@cox.net> ha scritto nel messaggio
news:V5BRd.32195$xt.25943@fed1read07...



[quoted text, click to view]

.... Do you mean something like in my app (see singature)?
You can start from the idea of
http://www.codeproject.com/cs/miscctrl/ruler.asp

[quoted text, click to view]

I didn't undersood :(
But I think you can do all via System.Drawings.


--
Reporting tool: http://www.neodatatype.net

AddThis Social Bookmark Button