Difference between revisions of "Component: GLCD Bitmap Drawer ROM (Graphical Library)"
(9 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Lib_Draw_Bitmap.fcfx FC_Comp_Source_Lib_Draw_Bitmap.fcfx] |
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Lib_Draw_Bitmap.fcfx FC_Comp_Source_Lib_Draw_Bitmap.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
Line 39: | Line 27: | ||
==Examples== | ==Examples== | ||
+ | The Bitmap Drawer component must be linked to the graphical LCD using the gLCD Object property. | ||
+ | [[File:BitmapDrawerProp.jpg]] | ||
+ | Here is an example which loops drawing a monochrome and 24-bit bitmaps to the EBM001 graphical display. | ||
+ | {{Fcfile|BitmapDrawerDemo.fcfx|Bitmap Drawer Demo}} | ||
+ | The bitmap files used in the example can be found here. | ||
+ | {{Zip|BitmapDrawerDemo.zip|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. | ||
+ | {{Fcfile|BitmapDrawerDemo2.fcfx|Bitmap Drawer Demo 2}} | ||
+ | The bitmap files used in the example can be found here. | ||
+ | {{Zip|BitmapDrawerDemo2.zip|Bitmap Drawer Files 2}} | ||
Line 55: | Line 53: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Macro reference== | ==Macro reference== | ||
+ | ===Display_BMP=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Display_BMP''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Draws the bitmap image from ROM onto the display at the corrdinates X and Y. |
|- | |- | ||
|- | |- | ||
Line 93: | Line 78: | ||
| colspan="2" | Selects from attached bitmaps. Range: 0-9 | | colspan="2" | Selects from attached bitmaps. Range: 0-9 | ||
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90% | + | | width="90%" | X |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="2" | X Axis coordinate, specifies the location of the left edge of the bitmap image |
− | |||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
+ | | width="90%" | Y | ||
|- | |- | ||
+ | | colspan="2" | Y Axis coordinate, specifies the location of the top edge of the bitmap image | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Orientation |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | 0=Normal, 1=90 Degrees CW, 2=180 Degrees, 3=270 Degrees CW | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Transparency |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0=Off, 1=On Don't Draw Any Pixels which match the transparent colour |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Flip |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0=Normal, 1=FlipWidth, 2=FlipHeight, 3=FlipBoth |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 144: | Line 108: | ||
+ | ===Display_BMP_Fast=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Display_BMP_Fast''' |
|- | |- | ||
− | | colspan="2" | Draws the bitmap image from ROM onto the display at the corrdinates X and Y. | + | | colspan="2" | 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. |
|- | |- | ||
|- | |- | ||
Line 167: | Line 132: | ||
| colspan="2" | Y Axis coordinate, specifies the location of the top edge of the bitmap image | | colspan="2" | Y Axis coordinate, specifies the location of the top edge of the bitmap image | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
− | | width="90%" | | + | | width="90%" | Mode |
+ | |- | ||
+ | | colspan="2" | 0=RowByRow, 1=FullWindow(Y Flipped) | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===GetHeight=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
− | | | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHeight''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Returns the height of the loaded bitmap file in pixels. |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | BitmapIndex |
|- | |- | ||
− | | colspan="2" | 0 | + | | colspan="2" | Selects from attached bitmaps. Range: 0-9 |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetWidth=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWidth''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Returns the width of the loaded bitmap file in pixels. |
|- | |- | ||
|- | |- | ||
Line 200: | Line 175: | ||
| colspan="2" | Selects from attached bitmaps. Range: 0-9 | | colspan="2" | Selects from attached bitmaps. Range: 0-9 | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===SetTransparentColour=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTransparentColour''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the transparency colour, the colour that is not drawn when transparency is enabled. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | R | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | G |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | B |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 10:26, 20 October 2023
Author | Matrix TSL |
Version | 2.2 |
Category | Graphical Library |
Contents
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
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
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.
The bitmap files used in the example can be found here.
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.
The bitmap files used in the example can be found here.
Macro reference
Display_BMP
Display_BMP_Fast
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 |
SetTransparentColour
SetTransparentColour | |
Sets the transparency colour, the colour that is not drawn when transparency is enabled. | |
- BYTE | R |
- BYTE | G |
- BYTE | B |
- VOID | Return |