LoadBitmap


bitmap = LoadBitmap(filename$)

This function loads a bitmap from the sdcard. The value returned is an object variable that contains the bitmap and can be used in other drawing commands. PNG graphics files are the preferred format because they support transparency. JPG files will also work but they do not support transparency.

If you try to load a bitmap which is larger than the screen, it will be scaled down to a size that will fit on the screen. This is done in an attempt to prevent out of memory errors. Out of memory errors may still occur if too many large images are loaded at one time.


Example:


Graphics On
Color 40,40,40
CLS

bitmap = LoadBitmap("graphics/mypic.png")

DrawBitmap bitmap, ScreenX()/2, ScreenY()/2

Wait 10000






CreateBitmap


SaveBitmap


DrawBitmap


CopySurface


CopyBitmap


SetDrawingSurface


GetBitmapWidth()


GetBitmapHeight()


GetBitmapPixel()


GetBitmapPixelRGBA()






Become a Patron