EasyGUI  Version v1.0
Image

Image display widget. More...

Data Structures

struct  gui_image_desc_t
 Image descriptor structure. More...
 
struct  gui_image_t
 Image object structure. More...
 

Functions

gui_handle_p gui_image_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags)
 Create new image widget. More...
 
uint8_t gui_image_setsource (gui_handle_p h, const gui_image_desc_t *img)
 Set image source to draw. More...
 

Detailed Description

Image display widget.

Image widget can display images of different color depth (ARGB8888, RGB888 or RGB565)

image_widget_image.png
Image widget of 3 images. On the left is ARGB8888 (TrueColor with alpha), middle one is RGB888 and right one format is RGB565
Note
When image has transparent alpha channel then on each redraw, parent widget must be redrawn. In other words, each image with alpha channel which is not maximum (fully visible) must use more resources to redraw image widget by redrawing parent first. On above image is clearly visible how left image has transparency (source data) over button.

Example code for example above

Function Documentation

◆ gui_image_create()

gui_handle_p gui_image_create ( gui_id_t  id,
float  x,
float  y,
float  width,
float  height,
gui_handle_p  parent,
gui_widget_evt_fn  evt_fn,
uint16_t  flags 
)

Create new image widget.

Parameters
[in]idWidget unique ID to use for identity for callback processing
[in]xWidget X position relative to parent widget
[in]yWidget Y position relative to parent widget
[in]widthWidget width in units of pixels
[in]heightWidget height in units of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]evt_fnCustom widget callback function. Set to NULL to use default callback
[in]flagsflags for widget creation
Returns
Widget handle on success, NULL otherwise

◆ gui_image_setsource()

uint8_t gui_image_setsource ( gui_handle_p  h,
const gui_image_desc_t img 
)

Set image source to draw.

Parameters
[in]hWidget handle
[in]imgImage object. Set to NULL to clear image
Returns
1 on success, 0 otherwise