Re: Drawing on DC
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Fri, 17 Nov 2006 19:54:32 -0500
MarcoMB wrote:
i looked at Scribble example in my MSDN samples section but unfortunatly i didn't found something to solve my problem, since scribble regards only line object that haven't to be continously deleted and redrawed on DC like my geometric and user positioning object...i rather think maybe i wold have to implement a bufer DC...do you?
The lesson that you should have learned from the Scribble tutorial is that you have to draw the objects in the OnDraw function. If you don't, they disappear.
The WM_MOUSEMOVE handler should just change variables and call Invalidate. It should not draw. Invalidate causes OnDraw to execute, and it uses the changed variables to draw.
Another example program that may help you is the DrawCLI MFC sample program. It is an example of a drawing editor program.
--
Scott McPhillips [VC++ MVP]
.
- Follow-Ups:
- Re: Drawing on DC
- From: Joseph M . Newcomer
- Re: Drawing on DC
- References:
- Re: Drawing on DC
- From: Joseph M . Newcomer
- Re: Drawing on DC
- Prev by Date: How to import a tab delimited text file into MS Access database
- Next by Date: Re: Creating Run Time Controls
- Previous by thread: Re: Drawing on DC
- Next by thread: Re: Drawing on DC
- Index(es):