Difference between revisions of "Component: Bitmap Drawer (Displays: Graphical)"

From Flowcode Help
Jump to navigationJump to search
(XML import BR)
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
|-
 
|-
 
| width="20%" style="color: gray;" | Version
 
| width="20%" style="color: gray;" | Version
| 1.0 (Release)
+
| 1.2 (Release)
 
|-
 
|-
 
| width="20%" style="color: gray;" | Category
 
| width="20%" style="color: gray;" | Category
Line 24: Line 24:
 
==Examples==
 
==Examples==
 
Here is an example which loops drawing a monochrome and 24-bit bitmaps to the EBM001 graphical display.
 
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.
  
{{Fcfile|BitmapDrawerDemo.fcfx|Bitmap Drawer Demo}}
+
[[File:BitmapDrawerDemo.zip]]
  
  
 +
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.
 
The bitmap files used in the example can be found here.
  
[[File:BitmapDrawerDemo.zip]]
+
[[File:BitmapDrawerDemo2.zip]]
 +
 
 +
==Downloadable macro reference==
 +
 
 +
===<span style="font-weight: normal;"><u><tt>Display_BMP_With_Transparency</tt></u></span>===
 +
Draws the stored bitmap image onto the display at the coordinates specified.
 +
 
 +
The coordinates specify the upper left corner of the image.
 +
 
 +
Skips over any pixels containing the transparent colour.
 +
 
 +
'''Parameters'''
 +
 
 +
:[[Variable Types|UINT]] ''X''
 +
 
 +
:[[Variable Types|UINT]] ''Y''
 +
 
 +
:[[Variable Types|BYTE]] ''TransR''
 +
::Red Colour Byte 0-255
 +
 
 +
:[[Variable Types|BYTE]] ''TransG''
 +
::Green Colour Byte 0-255
 +
 
 +
:[[Variable Types|BYTE]] ''TransB''
 +
::Blue Colour Byte 0-255
 +
 
 +
 
 +
'''Return value'''
 +
 
 +
:''This call does not return a value''
 +
 
 +
 
 +
===<span style="font-weight: normal;"><u><tt>GetHeight</tt></u></span>===
 +
Returns the height of the loaded bitmap file in pixels.
 +
 
 +
'''Parameters'''
 +
 
 +
:''This macro has no parameters''
  
  
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.
+
'''Return value'''
  
{{Fcfile|BitmapDrawerDemo2.fcfx|Bitmap Drawer Demo 2}}
+
:[[Variable Types|UINT]]
  
  
The bitmap files used in the example can be found here.
+
===<span style="font-weight: normal;"><u><tt>GetWidth</tt></u></span>===
 +
Returns the width of the loaded bitmap file in pixels.
  
[[File:BitmapDrawerDemo2.zip]]
+
'''Parameters'''
  
 +
:''This macro has no parameters''
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>Display_BMP</tt></u></span>===
+
'''Return value'''
  
Draws the stored bitmap image onto the display at the coordinates specified.
+
:[[Variable Types|UINT]]
  
The coordinates specify the upper left corner of the image.
 
  
 +
===<span style="font-weight: normal;"><u><tt>Display_BMP</tt></u></span>===
 +
Draws the bitmap image from ROM onto the display at the corrdinates X and Y.
  
 
'''Parameters'''
 
'''Parameters'''
  
 
:[[Variable Types|UINT]] ''X''
 
:[[Variable Types|UINT]] ''X''
 +
::X Axis coordinate, specifies the location of the left edge of the bitmap image
  
 
:[[Variable Types|UINT]] ''Y''
 
:[[Variable Types|UINT]] ''Y''
 +
::Y Axis coordinate, specifies the location of the top edge of the bitmap image
  
  
Line 62: Line 107:
  
 
:''This call does not return a value''
 
:''This call does not return a value''
 +
 +
  
 
==Simulation macro reference==
 
==Simulation macro reference==
Line 80: Line 127:
  
 
Bitmap file you wish to embed into the program
 
Bitmap file you wish to embed into the program
 +
 +
<span style="font-weight: normal;"><u>File Colour Depth</u></span>
 +
 +
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''ColourDepth''.
 +
 +
Number of bits per pixel.
 +
 +
Currently the component only supports bitmap files with 1-bit or 24-bit colour depth.
  
 
<span style="font-weight: normal;"><u>File Length</u></span>
 
<span style="font-weight: normal;"><u>File Length</u></span>
Line 85: Line 140:
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''file_Len''.
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''file_Len''.
  
Bitmap file size in bytes
+
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.
 +
 
 +
<span style="font-weight: normal;"><u>File Width</u></span>
 +
 
 +
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''FileWidth''.
 +
 
 +
Width of the bitmap file in pixels
 +
 
 +
<span style="font-weight: normal;"><u>File Height</u></span>
 +
 
 +
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''FileHeight''.
 +
 
 +
Height of the bitmap file in pixels
 +
 
 +
<span style="font-weight: normal;"><u>Data Offset</u></span>
 +
 
 +
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''DataOffset''.
 +
 
 +
Offset in the file where the bitmap pixel data starts
  
 
<span style="font-weight: normal;"><u>ColourDisplay</u></span>
 
<span style="font-weight: normal;"><u>ColourDisplay</u></span>

Latest revision as of 15:45, 16 February 2017


Author Matrix TSL
Version 1.2 (Release)
Category Displays: Graphical


Image Bitmap Drawer component

A component to simplify the process of drawing bitmap images to a graphical display. Stores the bitmap image inside a ROM look up table. Compatible with 24-bit Bitmaps and Monochrome Bitmaps. The gLCD object property specifies which LCD component to draw the bitmap to. Use multiple BitmapDrawer components for multiple bitmap images.

Examples

Here is an example which loops drawing a monochrome and 24-bit bitmaps to the EBM001 graphical display. FC6 Icon.png Bitmap Drawer Demo The bitmap files used in the example can be found here.

File:BitmapDrawerDemo.zip


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. FC6 Icon.png Bitmap Drawer Demo 2 The bitmap files used in the example can be found here.

File:BitmapDrawerDemo2.zip

Downloadable macro reference

Display_BMP_With_Transparency

Draws the stored bitmap image onto the display at the coordinates specified.

The coordinates specify the upper left corner of the image.

Skips over any pixels containing the transparent colour.

Parameters

UINT X
UINT Y
BYTE TransR
Red Colour Byte 0-255
BYTE TransG
Green Colour Byte 0-255
BYTE TransB
Blue Colour Byte 0-255


Return value

This call does not return a value


GetHeight

Returns the height of the loaded bitmap file in pixels.

Parameters

This macro has no parameters


Return value

UINT


GetWidth

Returns the width of the loaded bitmap file in pixels.

Parameters

This macro has no parameters


Return value

UINT


Display_BMP

Draws the bitmap image from ROM onto the display at the corrdinates X and Y.

Parameters

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


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

gLCD Object

This property is of type Panel object and can be referenced with the variable name glcd_obj.

Graphical LCD Object to draw the bitmap image to

Bitmap File

This property is of type Filename and can be referenced with the variable name bitmap_file.

Bitmap file you wish to embed into the program

File Colour Depth

This property is of type Unsigned integer and can be referenced with the variable name ColourDepth.

Number of bits per pixel.

Currently the component only supports bitmap files with 1-bit or 24-bit colour depth.

File Length

This property is of type Unsigned integer and can be referenced with the variable name file_Len.

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.

File Width

This property is of type Unsigned integer and can be referenced with the variable name FileWidth.

Width of the bitmap file in pixels

File Height

This property is of type Unsigned integer and can be referenced with the variable name FileHeight.

Height of the bitmap file in pixels

Data Offset

This property is of type Unsigned integer and can be referenced with the variable name DataOffset.

Offset in the file where the bitmap pixel data starts

ColourDisplay

This property is of type True or false and can be referenced with the variable name Colour_Display.

Automatically detects if the graphical LCD object is colour or monochrome