Device Context.
-
why CPaintDC not used in other than OnPaint()?
-
why CPaintDC not used in other than OnPaint()?
for a
WM_PAINT
messaege we do the drawings withing BeginPaint and EndPaint.CPaintDC
callsBeginPaint
at construction time and EndPaint at destruction time. From MSDN: CPaintDC objects encapsulate the common idiom of Windows, calling the BeginPaint function, then drawing in the device context, then calling the EndPaint function. The CPaintDC constructor calls BeginPaint for you, and the destructor calls EndPaint. The simplified process is to create the CDC object, draw, and destroy the CDC object. In the framework, much of even this process is automated. In particular, your OnDraw function is passed a CPaintDC already prepared (via OnPrepareDC), and you simply draw into it. It is destroyed by the framework and the underlying device context is released to Windows upon return from the call to your OnDraw function. SaRath.
_"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
-
for a
WM_PAINT
messaege we do the drawings withing BeginPaint and EndPaint.CPaintDC
callsBeginPaint
at construction time and EndPaint at destruction time. From MSDN: CPaintDC objects encapsulate the common idiom of Windows, calling the BeginPaint function, then drawing in the device context, then calling the EndPaint function. The CPaintDC constructor calls BeginPaint for you, and the destructor calls EndPaint. The simplified process is to create the CDC object, draw, and destroy the CDC object. In the framework, much of even this process is automated. In particular, your OnDraw function is passed a CPaintDC already prepared (via OnPrepareDC), and you simply draw into it. It is destroyed by the framework and the underlying device context is released to Windows upon return from the call to your OnDraw function. SaRath.
_"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
hi sarath, why it is not working if i use CPaintDc in onLButtonDown()?
-
hi sarath, why it is not working if i use CPaintDc in onLButtonDown()?
Now again i use from MSDN From the MSDN The CPaintDC class is a device-context class derived from CDC_**
**_
whitesky