Date: 02-16-2022
Return to Index
created by gbSnippets
Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As Long array of RGBQuad
End Type
Type BITMAPINFOHEADER
biSize As Dword number of bytes required by the structure
biWidth As Long width of bitmap
biHeight As Long height of bitmap
biPlanes As Word number of planes (1)
biBitCount As Word bits-per-pixel
biCompression As Dword %BI_RGB (uncompressed)
biSizeImage As Dword 0 'size (bytes) of image
biXPelsPerMeter As Long 0
biYPelsPerMeter As Long 0
biClrUsed As Dword 0 '# color indexes in table that are used
biClrImportant As Dword 0 '# color indexes required to display bitmap
End Type
Type Bitmap
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Word
bmBitsPixel As Word
bmBits As Byte Ptr
End Type
bmType The bitmap type. This member must be zero.
bmWidth Width of bitmap. Must be greater than zero.
bmHeight Height of bitmap. Must be greater than zero
bmWidthBytes Number of bytes in each scan line.
bmPlanes Count of color planes.
bmBitsPixel Number of bits per pixel
bmBits Pointer to location of the bit values for the bitmap
(must be pointer to array of character (1-byte) values)
GetDIBits(hdc, hbmp, uStartScan, cScanLines, lpvBits, lpbi, uUsage)
hdc Handle to the device context.
hbmp Handle to bitmap. Must be a compatible bitmap (DDB)
uStartScan The first scan line to retrieve.
cScanLines The number of scan lines to retrieve.
lpvBits [out] Pointer to buffer to receive bitmap data.
If NULL, the function passes the dimensions and format
of the bitmap to the BITMAPINFO structure (lpbi)
lpbi Pointer to BITMAPINFO structure that specifies
desired format for the DIB data.
uUsage %DIB_RGB_COLORS
DC handle 1st #lines ptr to buffer ptr to BM
GetDIBits(hMemoryDC,hBitMap, 0, 0, ByVal %Null, ByVal VarPtr(bm), %DIB_RGB_Colors
GetDIBits(hTmpDC, hBitmap, 0, ySize, PixelArray(0), ByVal VarPtr(bi), %DIB_RGB_Colors
GetDIBits(memDC, hBmp, 0, yp, ByVal bitsPtr, ByVal VarPtr(bmInfo), %DIB_RGB_Colors
GetDIBits(hDC, hbm, 0, bm.bmheight, ByVal mem&, bi, %DIB_RGB_Colors
GetDIBits(hDC, hBMP, 0, pbih.biHeight, ByVal StrPtr(lpBits), ByVal VarPtr(pbi), %DIB_RGB_Colors
GetDIBits(lngDC, hBmSrc, 0, bmiHeader.biHeight, bImgData(1), bmpInfo, %DIB_RGB_Colors
'gbs_00950
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm