Skip to content

gui_image_file

pierre drezet edited this page Aug 20, 2025 · 1 revision
GUI Image File class="toc_span_items">Misc ↓ <a

href="#parameters">Params ↓

<a

href="#ports">Ports ↓

This component is used to create a widget to display an image in the GUI. The image to be shown is specified at design-time in the widget properties in the GUI Builder, LGB. Images can be loaded at run-time by presenting a filename to the data input [In]file and triggering the [In]load event. Images loaded at run-time are expected to be in the 'userdata' subdirectory of the target directory and can be PNG (.png), GIF (.gif) or JPEG (.jpg) format. This default location can be overridden by setting the parameter Load Image From App Directory to TRUE. This setting allows an image added to the project as a resource to be displayed in the widget at runtime, as resources are stored in the 'appdata' subdirectory of the target directory.

When the input event [In]create is triggered, the image specified at design-time in the GUI Builder, LGB, is loaded. If the input event [In]load has been triggered prior to [In]create, then the image specified by the filename presented to the data input [In]file is loaded. Please note that the input event [In]show needs to be triggered to display the image.

After the widget has been created and shown, a new image can be displayed by triggering the [In]load event. Once the input event [In]destroy has been triggered, the [In]create event needs to be triggered again before another image can be shown.

The position, dimensions, colour and transparency of the image are specified in the widget properties in the GUI Builder, LGB. The dimensions of the image as specified in LGB can be interpreted in two ways depending on the property, Maintain Aspect Ratio, in the Application Builder, Lucid Tools. If the property Maintain Aspect Ratio is set to TRUE then the dimensions as specified in LGB are used as a bounding box and the image fills either the vertical or horizontal extent of the box whilst retaining its original aspect ratio. If the property Maintain Aspect Ratio is set to FALSE then the image is stretched to the dimensions specified in LGB.

It should be noted that in LGB, there is a Lock Aspect Ratio check box in the widget properties dialog. When ticked, this preserves the aspect ratio of the image when the widget is resized in LGB. This is only to aid in the layout of images in the GUI. The Maintain Aspect Ratio property as specified in Lucid Tools, determines whether the image will stretch to fit the dimensions of the widget or retain its aspect ratio and use the widget dimensions as a bounding box.

The data inputs [In]off.x and [In]off.y can be used to change the position of the image by specifying the offset from its original position in the x and y axis respectively. The data inputs [In]off.wid and [In]off.ht can be used to specify an offset in the width and the height of the widget from the original dimensions and [In]alpha can be used to change the alpha value of the transparency of the widget. Note that if the property Maintain Aspect Ratio is set to TRUE then changes to the widget width using the data input [In]off.wid also change the height to maintain the aspect ratio and changes to height using the data input [In]off.ht are ignored.

The input event [In]create will allocate the memory for the image and [In]destroy will deallocate the memory. When the input event [In]create is triggered, data is presented to outputs [Out]abs x, [Out]abs y, [Out]wid and [Out]ht, describing the absolute position and dimensions of the image as created.

The input events [In]show and [In]hide will show and hide the image. The state of the image as shown or hidden is persistent, so that if [In]show is asserted before [In]create, the image will be shown when [In]create is asserted.

When the input event [In]update is asserted, the values presented to the inputs [In]off.x, [In]off.y, [In]off.wid, [In]off.ht and [In]alpha will be used to update the widget properties. Data is presented to outputs [Out]abs x, [Out]abs y, [Out]wid and [Out]ht, describing the updated absolute position and dimensions of the image. It should be noted that the data inputs [In]off.x and [In]off.y specify the offset in the x and y axis from its original position and the data outputs [Out]abs x and [Out]abs y refer to the absolute x and y coordinates of the widget in reference to the viewport. This allows the data output to be used to detect if widgets are overlapping in the GUI.

name type default min. max. description
Widget Tag WT None widget widget tag Name of the widget as displayed in the GUI builder.
Widget-Group String None default widget group Group that the widget belongs to in the GUI builder.
Maintain Aspect Ratio Boolean False False True Maintains aspect ratio of widget when width is changed and ignores changes in height if TRUE, allows width and height to be altered independently if FALSE.
Register Click Disregarding Z-Order Boolean False False True Allows a widget to register a mouse click event when it is hidden behind another widget if TRUE, the widget only registers mouse clicks if the widget is visible at the coords that the mouse click occurs at if FALSE.
Load Image From App Directory Boolean False False True Load the image from the app directory at runtime if TRUE, else load the image from the user directory.
Ports Top ↑ class="toc_span_items">Misc ↓ <a

href="#parameters">Params ↑

In Ev.
create Allocates memory for the image.
destroy Deallocates memory for the image.
load Loads the image specified by the data input
show Shows the image in the GUI.
hide Hides the image in the GUI.
update Updates the properties of the widget.
Data In
file Specifies the file name of the image to be loaded at runtime.
off.x Specifies the offset in the x axis of the widget from its initial position when the update event is asserted.
off.y Specifies the offset in the y axis of the widget from its initial position when the update event is asserted.
off.wid Specifies the offset in width of the widget from its original dimensions when the update event is asserted.
off.ht Specifies the offset in height of the widget from its original dimensions when the update event is asserted.
alpha Shows the image in the GUI.
Data Out
abs x The x coordinate of the image relative to the viewport origin presented when the create or update events are triggered.
abs y The y coordinate of the image relative to the viewport origin presented when the create or update events are triggered.
wid The width of the image presented when the create or update events are triggered.
ht The height of the image presented when the create or update events are triggered.
Out Ev.
--- Triggered when the input event [In]create is asserted.
--- Triggered when the input event [In]destroy is asserted.
--- Triggered when the input event [In]load is asserted.
--- Triggered when the input event [In]show is asserted.
--- Triggered when the input event [In]hide is asserted.
--- Triggered when the input event [In]update is asserted.
click Triggered when the user clicks on the image in the GUI.
mouse down Ttriggered when the user presses the mouse button and the pointer is over the image.
Misc Top ↑ class="toc_span_items">Ports ↑ <a

href="#parameters">Params ↑

State Machine Stateless.

Toolbox GUI. Version v2.1.
Licence Type MPL2.0 Component Supplier inx ltd.
Minumum DCC A0000 Profiles All.

Core Components

Events & Triggers

State Management

  • STATE - Represents a State in Lucid
  • state_condition - Event driven state condition --> transition and actions
  • state_debug - To debug state machines this function block is required.
  • state_manager - Each state machine is defined by a State Manager

Array & Data Structures

Buffers & Queues

Primitive Data Constants

Data Converters

Boolean Logic



Mathematics

Alebraic Evaluation

Mathematical Operators

Inequalities

Trigonometry

Other Functions

Data Selection

  • indexed_mux_int - Indexed Mux Int
  • indexed_mux_str - Indexed Mux String
  • map_int - Map Int
  • mux_1b - mux_1b
  • mux_1i - mux_1i
  • mux_1r - mux_1r
  • mux_1s - mux_1s
  • mux_2b - MultiplexTwo Input Bool
  • mux_2i - MultiplexTwo Input Int
  • mux_2r - MultiplexTwo Input Real
  • mux_2s - MultiplexTwo Input String
  • mux_3b - MultiplexThree Input Bool
  • mux_3i - MultiplexThree Input Int
  • mux_3r - MultiplexThree Input Real
  • mux_3s - MultiplexThree Input String
  • mux_4b - MultiplexFour Input Bool
  • mux_4i - MultiplexFour Input Int
  • mux_4r - MultiplexFour Input Real
  • mux_4s - MultiplexFour Input String
  • mux_8b - 8-Input Indexed Boolean Multiplexer Function Block
  • mux_8i - 8-Input Indexed Integer Multiplexer Function Block
  • mux_8r - 8-Input Real Number Multiplexer Function Block
  • mux_8s - Number Multiplexer Function Block
  • num_mux - Numeric Multiplexer Function Block

Data Processing & Parsers

Database & Storage

Demultiplexers

String Functions

File Operations



Basic IO Components

GPIO & Hardware I/O



Graphics and UI Components

GUI & User Interface

User Input

  • keypress - Reads key presses & control keys

Unity & Web Integration

  • inx-unity - Provides media and animation widget interface
  • unity2 - Unity 3D
  • webkit - JavaScript/WebKit Interface (Obsolete)

Language & Localization



Media Components

Audio & Media

Digital TV & Media Control



Communications Components

TCPIP Network & Communication

Wireless & LPWAN Networks

Fieldbus Comms



Digital Signal Processing

  • ADC Polled Analogue to Digital converter.
  • ADC_continuous Advanced ADC supporting clocked ISR modes and advanced signal averaging.
  • FFT8 Fast Fourier Transform of 8 bit binary input data
  • FIR8 Finite Impulse Response filter for 8 bit binary data.
  • IIR8 Infinite Impulse Response filter for 8 bit binary data.
  • [calibrate](ADC calibrate) - Calibrates the ADCs


Control Systems Components

PID Controllers



Machine Learning & Machine Vision

  • mv_camera - Provides access to camera input data image streams
  • mv_idsplay - Renders camera image streams.
  • mv_resize - Resizes an image using given interpolation method
  • mv_crop - Crops and image width and height at a give offset
  • mv_apriltag_reader Plain Old Prgramming AprilTag Reader
  • ml_tflite_inference Machine learning model inference.
  • ml_osvm Online iterative machine learning (training& inference).


Platform Components

System Utilities

  • reboot - Reboot the device
  • rtc - RealTimeClock - provdes date/time from RTC device or OS.
  • rtinfo - RuntimeInfo (e.g. MAC/IP address, memory,... )
  • scheduler - Weekly Scheduler
  • system_exec - Executes linux shell commands
  • rng - Random Number Generator (may use hardware RNG)

Time Components

Application Management

Over the Air Update (OTA)

  • ota - OTA Function Block for updating firmware
  • ota_data_parser - Assembles OTA data files from Devman.


Non-functional Components

Some function blocks that can be used Lucid app are for visual/organisation purposes only and do not translate into any executable ert-components.

Sub System Input/Output Ports

-Note this file is autogenerated from ert-config help files and may not currently be complete or properly categorised!

Clone this wiki locally