version 2.8
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 TRUE in your gfxconf.h
GFX_USE_GWIN must be set to TRUE in your gfxconf.h
GDISP_NEED_IMAGE must be set to TRUE in your gfxconf.h
GWIN_NEED_IMAGE must be set to TRUE 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...
 
bool_t 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

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.
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.
bool_t gwinImageOpenGFile ( GHandle  gh,
GFILE f 
)

Opens the image using a GFILE.

Returns
TRUE 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

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

Opens the image using the specified filename.

Returns
TRUE 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 84 of file gwin_image.h.

#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 TRUE
Returns
TRUE 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 97 of file gwin_image.h.

#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
TRUE if the IO open function succeeds
Precondition
GFILE_NEED_CHIBIOSFS and GFX_USE_OS_CHIBIOS must be TRUE
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 109 of file gwin_image.h.