|
-
Feb 24th, 2003, 09:25 PM
#1
Thread Starter
Addicted Member
CreateCompatibleDC()
Is it okay to pass zero to this function as the hdc? I've seen some bitmap classes that load an image using LoadImage, and then create an hdc using CreateCompatibleDC, put 0 is passed to this function. I've also seen a blank bitmap created using CreateCompatibleBitmap(), and then the DC is created using CreateCompatibleDC(), but a value is required other than zero. What is the purpose of passing a value to CreateCompatibleDC()? When and when can't 0 be used?
thanks,
jmiller
-
Feb 28th, 2003, 03:50 AM
#2
Addicted Member
'0' for CreateCompatibleDC () signifies that the 'source' DC
that is used to derive a compatible DC will be the DC of your
application's foreground window. Once you have your DC handle
you can CreateCompatibleBitmap () a bitmap off of it.
hMemDC = CreateCompatibleDC ()
hBmp = CreateCompatibleBitmap (hMemDC, <width>, <height>)
-CC
P.S. Is that a ThunderCats avatar?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|