Snapping to grids? 
Author Message
 Snapping to grids?

I'm trying to make the mouse snap to grids drawn either by the Line method
or any other way that allows snapping. Anybody? Thanks for the help.

--
****************************************************************************
Mohammed AlQuraishi
SiteBuilder Level 2
ClubIE Team 4
Independent Microsoft Beta Tester
TechWeb/Microsoft 2nd Place ActiveX Contest Winner (Business)
http://www.*-*-*.com/

"It is the bias of our society that creates the smart and the stupid." a
*Smart* guy.
"To war is not only to win, it's also to fight."
****************************************************************************



Sun, 17 Sep 2000 03:00:00 GMT  
 Snapping to grids?

Quote:

>I'm trying to make the mouse snap to grids drawn either by the Line method
>or any other way that allows snapping. Anybody? Thanks for the help.

The way I know is to calculate the 'destination' coordinate before actually
plotting. I've done something like that, and here is what I used:

Public Function nX(X As Single) As Single
  If bSnapOn Then
    nX = X - (X Mod nGridGap)
  Else
    nX = X
  End If
End Function

The Y coordinate is identically calculated. nGridGap's value determines how
wide a distance you want between snap-on points. Hope that helps.

David O.



Mon, 18 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. snap to grid

2. Snap to Grid

3. Snap to grid off?

4. Turn the Snap to Grid Off

5. Snap To Grid Release Question

6. snap to grid

7. snap to grid

8. Snap To Grid

9. snap to grids

10. snap to grid

11. vb objects + snapping to a grid

12. Turn the snap grid on and off?

 

 
Powered by phpBB® Forum Software