µGFX  2.9
version 2.9
ImageBox

Detailed Description

ImageBox widget. Used to display images within the GWIN widget system.

GWIN allos it to create an image widget. The widget takes no user input.

Precondition
GFX_USE_GDISP must be set to GFXON in your gfxconf.h
GFX_USE_GWIN must be set to GFXON in your gfxconf.h
GDISP_NEED_IMAGE must be set to GFXON in your gfxconf.h
GWIN_NEED_IMAGE must be set to GFXON in your gfxconf.h
At least one image type must be enabled in your gfxconf.h

Functions

GHandle gwinGImageCreate (GDisplay *g, GImageObject *widget, GWindowInit *pInit)
 Create an image widget. More...
 
gBool gwinImageOpenGFile (GHandle gh, GFILE *f)
 Opens the image using a GFILE. More...
 
gdispImageError gwinImageCache (GHandle gh)
 Cache the image. More...
 

Macros

#define gwinImageOpenFile(gh, filename)   gwinImageOpenGFile((gh), gfileOpen((filename), "rb"))
 Opens the image using the specified filename. More...
 
#define gwinImageOpenMemory(gh, ptr)   gwinImageOpenGFile((gh), gfileOpenMemory((void *)(ptr), "rb"))
 Sets the input routines that support reading the image from memory in RAM or flash. More...
 
#define gwinImageOpenStream(gh, streamPtr)   gwinImageOpenGFile((gh), gfileOpenBaseFIleStream((streamPtr), "rb"))
 Sets the input routines that support reading the image from a BaseFileStream (eg. an SD-Card). More...
 

Function Documentation

◆ gwinGImageCreate()

GHandle gwinGImageCreate ( GDisplay *  g,
GImageObject *  widget,
GWindowInit pInit 
)

Create an image widget.

Display's a picture.

Returns
NULL if there is no resultant drawing area, otherwise the widget handle.
Parameters
[in]gThe GDisplay to display this window on
[in]widgetThe image widget structure to initialise. If this is NULL, the structure is dynamically allocated.
[in]pInitThe initialization parameters to use.
Note
The default background color gets set to the current default one.
An image window knows how to redraw.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gwinImageCache()

gdispImageError gwinImageCache ( GHandle  gh)

Cache the image.

Decodes and caches the current frame into RAM.

Parameters
[in]ghThe widget (must be an image widget)
Returns
GDISP_IMAGE_ERR_OK (0) on success or an error code.
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gwinImageOpenGFile()

gBool gwinImageOpenGFile ( GHandle  gh,
GFILE f 
)

Opens the image using a GFILE.

Returns
gTrue if the image can be opened
Parameters
[in]ghThe widget (must be an image widget)
[in]fThe open (for reading) GFILE to use
Function Class: Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

◆ gwinImageOpenFile

#define gwinImageOpenFile (   gh,
  filename 
)    gwinImageOpenGFile((gh), gfileOpen((filename), "rb"))

Opens the image using the specified filename.

Returns
gTrue if the open succeeds
Parameters
[in]ghThe widget (must be an image widget)
[in]filenameThe filename to open
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 80 of file gwin_image.h.

◆ gwinImageOpenMemory

#define gwinImageOpenMemory (   gh,
  ptr 
)    gwinImageOpenGFile((gh), gfileOpenMemory((void *)(ptr), "rb"))

Sets the input routines that support reading the image from memory in RAM or flash.

Precondition
GFILE_NEED_MEMFS must be GFXON
Returns
gTrue if the IO open function succeeds
Parameters
[in]ghThe widget (must be an image widget)
[in]ptrA pointer to the image in RAM or Flash
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 93 of file gwin_image.h.

◆ gwinImageOpenStream

#define gwinImageOpenStream (   gh,
  streamPtr 
)    gwinImageOpenGFile((gh), gfileOpenBaseFIleStream((streamPtr), "rb"))

Sets the input routines that support reading the image from a BaseFileStream (eg. an SD-Card).

Returns
gTrue if the IO open function succeeds
Precondition
GFILE_NEED_CHIBIOSFS and GFX_USE_OS_CHIBIOS must be GFXON
Parameters
[in]ghThe widget (must be an image widget)
[in]streamPtrA pointer to the (open) BaseFileStream object.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 105 of file gwin_image.h.