Need some help with Windows bitmaps...

BlitzPlus Forums/BlitzPlus Programming/Need some help with Windows bitmaps...

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.

I have coded a lot with Windows GDI, but I am not sure I understand what your question really is.

You can create a memory bitmap with DC handle like this (pseudocode):


; SomehDC is the DC of some bitmap with desired properties (bit depth etc)

Bitmap = CreateCompatibleBitmap(SomehDC,Width,Height)

hBitmap = GetObjectA(Bitmap,Len(SampleBitmap),SampleBitmap)


; Let's make a DC for the bitmap
hDC = CreateCompatibleDC(SomehDC)
SelectObject(hDC,Bitmap)



SampleBitmap is just an empty variable of this 14 byte long (Visual Basic) type:

    Type
            bmType As Long
            bmWidth As Long
            bmHeight As Long
            bmWidthBytes As Long
            bmPlanes As Integer
            bmBitsPixel As Integer
            bmBits As Long
    End Type