News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Process for Draw...

Started by RHL, April 09, 2012, 10:42:45 PM

Previous topic - Next topic

RHL

Hello Guys, I have a question, I'm draw a bitmap on a static control,
I use this process:

invoke BeginPaint...
    invoke CreateCompatibleDC ...
    invoke SelectObject ...
invoke BitBlt ...
invoke DeleteDC ....
    invoke EndPaint ....

      
My question is, if wanted to draw on 100 static controls :| , I would have use this process with each static control? or exist a form for simplify it? :)

dedndave

generally, we do not create a compatible DC inside the paint handler
it is done externally
you can put all your controls into the same DC

use the GetDC function, then CreateCompatibleDC - you may do that in WinMain, or in WM_CREATE
before you let the window close, destroy the compatible DC

then...
        INVOKE  BeginPaint...
        INVOKE  SelectObject...
        INVOKE  BitBlt...
        INVOKE  EndPaint....


ok - well, i see there are a few guys that do it that way - lol
seems to me like a lot of overhead in the paint handler

when i have done it (not much experience, really), i created a DC that was compatible with the desktop window
no matter how big they size the window, the DC is large enough
i used that same DC throughout the program

now, if your window is not sizable, you can create a smaller DC
then, update that DC, as required

RHL

: P
ok thanks dedndave, I will be trying to do it that way..