Restored from previous forum. Originally posted by GPI.
When you have a Windows-Bitmap-id
Try this:
Code: Select all
result=CreateImage(0,width,height)
StartDrawing(ImageOutput())
DrawImage(bitmap,0,0)
StopDrawing()
if you want to get the width and height:
Code: Select all
Procedure FreeImage_GetBitmapWidth(hBITMAP)
bmpinfo.bitmap
; Validate parameters
If hBITMAP = 0 : ProcedureReturn 0 : EndIf
If GetObjectType_(hBITMAP) #OBJ_BITMAP : ProcedureReturn 0 : EndIf
; Get the information for the bitmap
If GetObject_(hBITMAP, 4+4+4+4+2+2+4, BmpInfo) = 0 : ProcedureReturn 0 : EndIf
ProcedureReturn BmpInfo\bmWidth
EndProcedure
Procedure FreeImage_GetBitmapHeight(hBITMAP)
BmpInfo.BITMAP
; Validate parameters
If hBITMAP = 0 : ProcedureReturn 0 : EndIf
If GetObjectType_(hBITMAP) #OBJ_BITMAP : ProcedureReturn 0 : EndIf
; Get the information for the bitmap
If GetObject_(hBITMAP, 4+4+4+4+2+2+4, BmpInfo) = 0 : ProcedureReturn 0 : EndIf
ProcedureReturn BmpInfo\bmHeight
EndProcedure
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB