How can I get a Pointer on GDI? using Lock on DirectX?. Am not Using DirectX now am trying to use GDI32 (just GDI.....GDI....GDI repeating saying GDI untill 1000 times )
Posted on 2002-12-17 07:52:32 by realvampire
GetObject returns (among other things) a pointer to the raw data of a bitmap object.

Eoin has some excellent examples on what you're trying to do -

The "Back Buffer Shell" example would be a good one to start with.
Posted on 2002-12-17 08:03:36 by Qweerdy
:stupid: But I still confuse, if I must Use GetDIB can somebody made me a funtion called GDILock ?
Posted on 2002-12-20 04:51:44 by realvampire
If you want to modify a bitmap, all you have to do is:

BitmapInfo BITMAP <>

invoke GetObject,hBitmap,sizeof BITMAP,addr BitmapInfo

mov edi,BitmapInfo.bmBits ; Now edi points to the color values for all the pixels

; Fill the bitmap with black (example)
mov eax,BitmapInfo.bmWidthBytes
mul BitmapInfo.bmHeight
mov ecx,eax
xor eax,eax
rep stosb

You can create a blank DIB bitmap using a snippet from Eoin's tuts, or load a bitmap from a resource or file using LoadImage.

But I still confuse if I must Use GetDIB can somebody made me a funtion called GDILock ?

You don't understand the API so you ask us to make one to your specifications, is that it?

I have to wonder if you actually read those tutorials I told you about. If not: Study them, NOW!
Posted on 2002-12-20 05:15:24 by Qweerdy
I have read the tutorial. Thats What I want sire. I want to modify a Bitmap. now the I can obtain the Pointer and Also the color.

Posted on 2002-12-20 05:26:24 by realvampire