EasyGUI  v0.1
Platform independent GUI Library

Image display widget. More...

Data Structures

struct  GUI_IMAGE_DESC_t
 Image descriptor structure. More...
 
struct  GUI_IMAGE_t
 Image widget structure. More...
 

Functions

GUI_HANDLE_p gui_image_create (GUI_ID_t id, GUI_iDim_t x, GUI_iDim_t y, GUI_Dim_t width, GUI_Dim_t height, GUI_HANDLE_p parent, GUI_WIDGET_CALLBACK_t cb, 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

handle = gui_button_create(0, 10, 10, 300, 50, 0, 0, 0);
gui_widget_settext(handle, _GT("Button"));
handle = gui_image_create(0, 2, 2, bmimage_brand.xSize, bmimage_brand.ySize, 0, 0, 0);
gui_image_setsource(handle, &bmimage_brand);
handle = gui_image_create(0, 200, 40, bmimage_voyo.xSize, bmimage_voyo.ySize, 0, 0, 0);
gui_image_setsource(handle, &bmimage_voyo);
handle = gui_image_create(0, 350, 10, bmimage_voyo565.xSize, bmimage_voyo565.ySize, 0, 0, 0);
gui_image_setsource(handle, &bmimage_voyo565);

Function Documentation

GUI_HANDLE_p gui_image_create ( GUI_ID_t  id,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_Dim_t  width,
GUI_Dim_t  height,
GUI_HANDLE_p  parent,
GUI_WIDGET_CALLBACK_t  cb,
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 uints of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]cbPointer to GUI_WIDGET_CALLBACK_t callback function. Set to NULL to use default widget callback
[in]flagsFlags for widget creation
Return values
>0: GUI_HANDLE_p object of created widget
0Widget creation failed
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]*imgPointer to GUI_IMAGE_DESC_t image object. Use NULL to clear image
Return values
1Image was set ok
0Image was not set