How to access the content of BITBLT ?

Blitz3D Forums/Blitz3D Userlibs/How to access the content of BITBLT ?

Here is some code from a function which uses BitBlt to capture bits into a DIB...


    pBITMAP.bmiHeader.biSize = SIZEOF(pBITMAP.bmiHeader)
    pBITMAP.bmiHeader.biBitCount = 24
    pBITMAP.bmiHeader.biCompression = %BI_RGB
    pBITMAP.bmiHeader.biWidth = iWidth
    pBITMAP.bmiHeader.biHeight = -iHeight
    pBITMAP.bmiHeader.biClrUsed = 0
    pBITMAP.bmiHeader.biSizeImage = 0
    pBITMAP.bmiHeader.biPlanes = 1

    hDIBDC = CreateCompatibleDC(hDC)
    hDIB = CreateDIBSection(hDIBDC, pBITMAP, %DIB_RGB_COLORS, hImage, 0, 0)

    IF NOT (SelectObject(hDIBDC, hDIB)=%NULL) THEN

        Rtn = BitBlt(hDIBDC, 0, 0, iWidth, iHeight, hDC, 0, 0, %SRCCOPY)
        BuffSize = iWidth * iHeight * 3
        Rtn = MoveMemory(pRGB, hImage, buffsize)
        FUNCTION = BuffSize

    END IF

    Rtn = DeleteDC (hDIBDC)
    Rtn = DeleteObject (hDIB)    



Hope this helps...