By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,699 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,699 IT Pros & Developers. It's quick & easy.

drawing snap mode indicator

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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.