Click here to Skip to main content
15,886,519 members
Articles / Desktop Programming / MFC

Simple Snap-to-Grid cursor to your graphics application

Rate me:
Please Sign up or sign in to vote.
4.98/5 (23 votes)
26 Oct 20024 min read 117.2K   7K   74  
Simple Class to add Snap-to-Grid capability to a Windows drawing program.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by SnapCursorDemo.rc
//
#define IDD_ABOUTBOX                    100
#define IDD_SNAPCURSORDEMO_FORM         101
#define IDR_MAINFRAME                   128
#define IDR_SNAPCUTYPE                  129
#define IDC_RADIO_SNAPINCREMENT_5       1000
#define IDC_RADIO_SNAPINCREMENT_10      1001
#define IDC_RADIO_SNAP_INCREMENT_50     1002
#define IDC_STATIC_SNAP_INCREMENT       1003
#define IDC_BUTTON_GET_COLOR            1004

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS                     1
#define _APS_NEXT_RESOURCE_VALUE        130
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1005
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I am a hybrid CS and EE professional and 3D Animator/Modeler.

I have been a software developer since 1975, having coded in numerous languages, including C, C++, Java, Perl, Basic, PDP-11 and other assembly languages.

I have worked in the UNIX/C/Shellscript world as well as Windows/C++/Visual C++ platform areas.

I use 3DS MAX 7 for Animation and 3D modeling, combined with other graphics applications for overall production

I have worked on a wide variety of projects: language interpreters/compilers, graphics, automatic gpib test control programs, real-time automation in embedded systems, scientific and engineering applications as well as financial and business. I prefer the scientific, control system and engineering related software.

Major companies include Bell Labs, Singer Corporate Research and Tycom Submarine systems both as full-time and a contractor.

Other interests include Vacuum Tube collecting, Ham Radio (WA2WHV), Photography, 3D art, antiques, Abyssinian cats, Piano, travel, nature.

Comments and Discussions