TYPE BITMAP
bmType AS LONG
bmWidth AS LONG
bmHeight AS LONG
bmWidthBytes AS LONG
bmPlanes AS WORD
bmBitsPixel AS WORD
bmBits AS LONG
END TYPE
DECLARE FUNCTION CreateCompatibleBitmap LIB "gdi32" _
ALIAS "CreateCompatibleBitmap" (dc AS LONG, w AS LONG, h AS LONG) AS LONG
DECLARE FUNCTION GetObject LIB "gdi32" ALIAS "GetObjectA" (bmHandle _
AS LONG, buf AS LONG, bufsize AS LONG) AS LONG
DECLARE FUNCTION SelectObject LIB "gdi32" ALIAS "SelectObject" (hdc _
AS LONG, obj AS LONG) AS LONG
DIM Mem AS QMEMORYSTREAM
DIM QBM AS QBITMAP, rtn AS LONG, bm AS BITMAP
DIM hBM AS LONG
bmType=0
bmWidth=0
bmHeight=0
bmWidthBytes=0
bmPlanes=0
bmBitsPixel=0
bm.bmBits=0
Mem.WriteUDT(bm)
Mem.Position = 0
QBM.BMP = "c:\RapidQ\Yahoo.bmp"
CREATE Form AS QFORM
CREATE Image1 AS QIMAGE
Left = 0
top=0
Draw 5, 5, QBM.BMP
END CREATE
Center
END CREATE
hBM=CreateCompatibleBitmap(QBM.Handle,QBM.Width,QBM.Height)
rtn=SelectObject(QBM.Handle,hBM)
rtn=GetObject(hBM,SIZEOF(bm),Mem.Pointer)
Mem.Position = 0
Mem.ReadUDT(bm)
SHOWMESSAGE(STR$(bm.bmType))
SHOWMESSAGE(STR$(bm.bmWidth)+" "+STR$(bm.bmHeight))
SHOWMESSAGE(STR$(bm.bmWidthBytes))
SHOWMESSAGE(STR$(bm.bmPlanes))
SHOWMESSAGE(STR$(bm.bmBitsPixel))
SHOWMESSAGE(HEX$(bm.bmBits))
Form.SHOWMODAL
|