|Top Previous Next|
To obtain the offset, open the BMP file with romfile.open, then read the offset of this file from the romfile.offset R/O property. Naturally, the BMP file must be present in your project for this to work (see how to add a file).
Note that only 2-, 16-, and 256-color modes are currently supported and the lcd.bmp will return 1- NG if you try to display any other type of BMP file. Compressed BMP files will be rejected too.
The method takes into account the type of the currently selected controller/panel (selection is made through the Customize Platform dialog, accessible through the Project Settings dialog). It will check the values of lcd.paneltype, lcd.bitsperpixel, lcd.redbits, lcd.greenbits, and lcd.bluebits and produce the best output possible for the selected display.
X_offset, y_offset, maxwidth, and maxheight arguments allow you to display only a portion of the BMP image. This way it is possible to scroll around a large image that does not fit on the screen. Another use is to combine several separate images into a single file and display selected portions. This improves efficiency because romfile.open needs only be done once.