Poking Imagebuffers directly, it works! :)

Blitz3D Forums/Blitz3D Programming/Poking Imagebuffers directly, it works! :)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi,

From the information we gathered, Andreas has provided us with some functions that effectively work just as they do in BlitzPlus!

http://www.blitzcoder.com/cgi-bin/ubb-cgi/postdisplay.cgi?forum=Forum6&topic=001266

Additionaly, I figured out how to Blit from any window into a buffer, so a good day all round!

Snippet
[code]
; Assuming 32bit..
; 'temp' is the Bank pointing to our imagebuffer()
; the color bits are copied to it :)
hdcNew=api_CreateCompatibleDC(Bhdc) ; New Device Context to hold the Bitmap
hBmp=api_CreateBitmap(512,512,1,32,0) ; The Bitmap we'll Blit to
api_SelectObject(hdcNew,hBmp) ; Select the new Bitmap
api_BitBlt(hdcNew,0,0,512,512,SOURCE_HDC,DestX,DestY,SRCCOPY) ; Blit to the new bitmap
api_GetBitmapBits(hBmp,512*4*512,temp) ; Copy the Bitmap Bits (color!) from Bitmap to temp (our image buffer!)
...
free up HDCs e.t.c..........
[/CODE]

Cya!
Tom