' load bitmap image file #ifndef __LOADBITMAPIMAGE__ #define __LOADBITMAPIMAGE__ Function LoadBitmapImage(ByRef fname As Const string) As Any Ptr Dim As Integer f Dim As Long w, h ' open bitmap file f = FreeFile() Open fname For Binary Access Read As #f If Err > 0 Then Print "Error: Can not open file" : Return 0 Get #f, 19, w ' get width Get #f, , h ' get height Close #f ' Print "Bitmap : " & fname & " (w,h)=(" & w & "," & h & ")" ' create image Dim As Any Ptr img = ImageCreate(w, h, RGB(0, 0, 0)) If img = 0 Then Print "Error: Can not ImageCreate()" : Return 0 ' load bitmap to image bload fname, img Return img End Function #endif