AnitraZ
asked on
Handles
Hello. I'm trying to copy BMP data (32bpp) from an array to an StdPicture object. I found many examples on the net, I see that using GDI I can easily handle this, but...
hDCSrc=GetDC(0)
hDCMemory=CreateCompatible DC(hDCSrc)
hBmp=CreateCompatibleBitma p(hDCSrc, Width, Height)
hBmpPrev=SelectObject(hDCM emory, hBmp)
Call BitBlt(hDCMemory, 0, 0, Width, Height, hDCSrc, 0, 0, vbSrcCopy)
hBmp=SelectObject(hDCMemor y, hBmpPrev)
[...]
This code looks very fast, but what are all those handles? I mean, I create a compatible DC, right? Then I should set the array to that DC, using SetBitmapBits(). And then I call OleCreatePictureIndirect() . But in the example above this doesn't happens. It gets a DC from 0 (???), then selects something, getting another handle... An then uses BitBlt (not SetBitmapBits), and again, SelectObject. What are all those handles? I'll be glad if you could explain me those API calls, or at least what the a handle is. Thanks.
AnitraZ
hDCSrc=GetDC(0)
hDCMemory=CreateCompatible
hBmp=CreateCompatibleBitma
hBmpPrev=SelectObject(hDCM
Call BitBlt(hDCMemory, 0, 0, Width, Height, hDCSrc, 0, 0, vbSrcCopy)
hBmp=SelectObject(hDCMemor
[...]
This code looks very fast, but what are all those handles? I mean, I create a compatible DC, right? Then I should set the array to that DC, using SetBitmapBits(). And then I call OleCreatePictureIndirect()
AnitraZ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
AnitraZ