470,631 Members | 1,622 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

drawing snap mode indicator

Sam
Hi guys

I'm writing a small drawing program which has "snap to grid" mode and I
want to display something (some kind of shapes for example a small square or
circle which indicate the current snap point of my mouse) but I have no
success so far. I tried controlpain.drawreversibleframe method to draw a
tiny square to indicate my current snap point of my mouse as it moves on my
grid points; and this somwhat gives me what I want. The problem with this
method is that everytime I call invalidate method of my picturebox(my
drawing surface), there will be one extra square drawn by
drawingreversibleframe method. This solution is even worse when it comes to
resizing form because the controlpaint method has no restriction within my
drawing surface.

Does anyone have any other ideas to implement this? In VB6 I used a shape
control and set its background to transparent property and this gave me what
I want. I was thinking to use a drawing square method of GDI+ to implement
this or a small label to serve as an indicator but then I have to call my
control's invalidate method to redraw everything as my mouse moves but this
is not efficient way to do.

Regards,

Sam
Nov 21 '05 #1
1 1581
Hi,

Check out Carl Franklins SelectForm.Zip example.

http://www.franklins.net/dotnet/

Ken
--------------------
"Sam" <qd*@datawave.ca> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Hi guys

I'm writing a small drawing program which has "snap to grid" mode and I
want to display something (some kind of shapes for example a small square or
circle which indicate the current snap point of my mouse) but I have no
success so far. I tried controlpain.drawreversibleframe method to draw a
tiny square to indicate my current snap point of my mouse as it moves on my
grid points; and this somwhat gives me what I want. The problem with this
method is that everytime I call invalidate method of my picturebox(my
drawing surface), there will be one extra square drawn by
drawingreversibleframe method. This solution is even worse when it comes to
resizing form because the controlpaint method has no restriction within my
drawing surface.

Does anyone have any other ideas to implement this? In VB6 I used a shape
control and set its background to transparent property and this gave me what
I want. I was thinking to use a drawing square method of GDI+ to implement
this or a small label to serve as an indicator but then I have to call my
control's invalidate method to redraw everything as my mouse moves but this
is not efficient way to do.

Regards,

Sam

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rhonda | last post: by
2 posts views Thread by Vishruth | last post: by
2 posts views Thread by SStory | last post: by
6 posts views Thread by Jim Hubbard | last post: by
1 post views Thread by Marc Gravell | last post: by
9 posts views Thread by liorm | last post: by
4 posts views Thread by Billy Bob | last post: by
80 posts views Thread by nicolas.sitbon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.