| Author
|
Matrix TSL
|
| Version
|
3.0
|
| Category
|
Graphical Library
|
GLCD Bitmap Drawer ROM component
A component to simplify the process of drawing bitmap images to a graphical display. Stores up to 10 bitmap images inside ROM based look up tables. Compatible with 24-bit / 256 Colour / 16 Colour / Monochrome Bitmaps. The gLCD object property specifies which LCD component to draw the bitmap to. Compatible with GLCD, NeoPixel, MIACv3, HT16K33
Version information
Library Version, Component Version, Date, Author, Info
13, 2.2, 22-07-24, BR, Updated Bitmap Mono Dummy Component - Testing
14, 2.3, 24-07-24, BR, Fixed a problem with file size reporting of 4/8 bit bitmaps
14, 2.3, 24-07-24, BR, Added Pallet size information for 4/8 bit bitmaps
15, 2.3, 24-07-24, BR, Reduced stored Pallet size by 1/4
16, 2.3, 26-07-24, BR, Added reload file property allowing for easier way to update bitmaps from source
17, 2.4, 12-08-24, BR, Added LookupFilename function to allow the component to work with DisplayManager
Detailed description
No detailed description exists yet for this component
Examples
The Bitmap Drawer component must be linked to the graphical LCD using the gLCD Object property.
Here is an example which loops drawing a monochrome and 24-bit bitmaps to the EBM001 graphical display.
Bitmap Drawer Demo
The bitmap files used in the example can be found here.
Bitmap Drawer Files
Here is another example which overlays several monochrome images to give the impression of animation. Shows a pair of eyes, which can randomly and momentarily look left, right or blink.
Bitmap Drawer Demo 2
The bitmap files used in the example can be found here.
Bitmap Drawer Files 2
Macro reference
Display_BMP
|
Display_BMP
|
| Draws the bitmap image from ROM onto the display at the corrdinates X and Y.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
X
|
| X Axis coordinate, specifies the location of the left edge of the bitmap image
|
- UINT
|
Y
|
| Y Axis coordinate, specifies the location of the top edge of the bitmap image
|
- BYTE
|
Orientation
|
| 0=Normal, 1=90 Degrees CW, 2=180 Degrees, 3=270 Degrees CW
|
- BYTE
|
Transparency
|
| 0=Off, 1=On Don't Draw Any Pixels which match the transparent colour
|
- BYTE
|
Flip
|
| 0=Normal, 1=FlipWidth, 2=FlipHeight, 3=FlipBoth
|
- VOID
|
Return
|
Display_BMP_Fast
|
Display_BMP_Fast
|
| Draws the bitmap image from ROM onto the display at the corrdinates X and Y. Speeds up drawing by not assigning X/Y coordinate for each pixel. Currently only supports colour displays.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
X
|
| X Axis coordinate, specifies the location of the left edge of the bitmap image
|
- UINT
|
Y
|
| Y Axis coordinate, specifies the location of the top edge of the bitmap image
|
- BOOL
|
Mode
|
| 0=RowByRow, 1=FullWindow(Y Flipped)
|
- VOID
|
Return
|
Display_Scaled_BMP
|
Display_Scaled_BMP
|
| Draws the bitmap image from ROM onto the display at the corrdinates X and Y. Scales the bitmap to the specified width and height.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
X
|
| X Axis coordinate, specifies the location of the left edge of the bitmap image
|
- UINT
|
Y
|
| Y Axis coordinate, specifies the location of the top edge of the bitmap image
|
- UINT
|
Width
|
| The size in pixels to draw the bitmap image
|
- UINT
|
Height
|
| The size in pixels to draw the bitmap image
|
- BYTE
|
Orientation
|
| 0=Normal, 1=90 Degrees CW, 2=180 Degrees, 3=270 Degrees CW
|
- BYTE
|
Transparency
|
| 0=Off, 1=On Don't Draw Any Pixels which match the transparent colour
|
- BYTE
|
Flip
|
| 0=Normal, 1=FlipWidth, 2=FlipHeight, 3=FlipBoth
|
- VOID
|
Return
|
Display_Scaled_BMP_Fast
|
Display_Scaled_BMP_Fast
|
| Draws the bitmap image from ROM onto the display at the corrdinates X and Y. Scales the bitmap to the specified width and height. Speeds up drawing by not assigning X/Y coordinate for each pixel. Currently only supports colour displays.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
X
|
| X Axis coordinate, specifies the location of the left edge of the bitmap image
|
- UINT
|
Y
|
| Y Axis coordinate, specifies the location of the top edge of the bitmap image
|
- UINT
|
Width
|
| The size in pixels to draw the bitmap image
|
- UINT
|
Height
|
| The size in pixels to draw the bitmap image
|
- BOOL
|
Mode
|
| 0=RowByRow, 1=FullWindow(Y Flipped)
|
- VOID
|
Return
|
GetHeight
|
GetHeight
|
| Returns the height of the loaded bitmap file in pixels.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
Return
|
GetWidth
|
GetWidth
|
| Returns the width of the loaded bitmap file in pixels.
|
- BYTE
|
BitmapIndex
|
| Selects from attached bitmaps. Range: 0-9
|
- UINT
|
Return
|
LookupFilename
|
LookupFilename
|
| Checks to see if one of the loaded files matches the supplied filename. If a match is found then returns the bitmap index 0-9. If no match is found then returns 255.
|
- STRING
|
Filename
|
| Filename without the included path e.g. "sprite.bmp", not case sensitive
|
- BYTE
|
Return
|
SetTransparentColour
|
SetTransparentColour
|
| Sets the transparency colour, the colour that is not drawn when transparency is enabled.
|
- BYTE
|
R
|
|
|
- BYTE
|
G
|
|
|
- BYTE
|
B
|
|
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
LinkTo
|
|
|
|
ColourDisplay
|
| Automatically detects if the graphical LCD object is colour or monochrome
|
|
ROM Bytes
|
| Total number of ROM bytes used to store attached bitmap images.
|
|
Number of Bitmaps
|
| Number of bitmaps the component can store and draw to the LCD. Min 1 / Max 10
|
|
Reload Bitmaps
|
| Reloads all bitmaps from source, useful to do when the bitmap files change. Will automatically reset to No when complete.
|
|
Bitmap 0
|
|
Bitmap File
|
| Bitmap file you wish to embed into the program. Compatible with .bmp files in the following formats: 24-Bit / 256 Colour / 16 Colour / Monochrome
|
|
File Colour Depth
|
| Number of bits per pixel. Currently the component only supports bitmap files with 1-bit or 24-bit colour depth.
|
|
File Width
|
| Width of the bitmap file in pixels
|
|
File Height
|
| Height of the bitmap file in pixels
|
|
File Length
|
| The number of bytes of ROM the bitmap file will consume. You can vie wthe number of ROM bytes available on your target device using the Device Helper component.
|
|
Pallet Size
|
| Number of bytes in the file length used to store the colour pallet
|
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Lib_Draw_Bitmap.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Lib_Draw_Bitmap.fcfx