Developer

API Reference

IWidget_SetImage()

Brew Release
Brew MP 1.0.2
See Also
IWidget_SetScale() IImage Interface
Description
This function will set the image to be displayed within an image widget. The pointer passed in 'piImage' will be stored in the interface model associated with the widget and it's reference count will be incremented.
If you intend to scale the image, be sure to pass the unscaled image to IWidget_SetImage() then call IWidget_SetScale() to perform the scale. Scaling the image via IIMAGE_SetParm() before (or after) passing it to this routine will cause undesirable behavior, particularly if the image is scaled beyond the extent of the image widget.
Avoid using IIMAGE_SetParm() on the IImage when it has been set on an image widget. The image widget will set many of these parameters itself and will depend on the persistance of these settings.
The IImage passed to IWidget_SetImage() must have been completely loaded and decoded. It is the application's responsibility to wait for image formats such as png, jpg and gif (and any media type that requires decoding) to completely decode before passing them to the image widget. For example, if an app uses ISHELL_LoadResImage() to load a jpg image from a resource file, it must do an IIMAGE_Notify() to wait for the image to completely load before passing the resulting pointer to IWidget_SetImage(). For more details on IIMAGE_Notify, see the BREW documentation on the IImage interface.
Parameters
  • pif
    []:
    [in] Pointer to the image widget object.
  • piImage
    []:
    [in] Pointer to an IImage that contains the image to be displayed by the image widget.
Interface
Prototype
   int IWidget_SetImage(IWidget *pif, IImage *piImage)
Return
   AEE_SUCCESS - If BREW was able to successfully store 'piImage' in the model associated
                 with the image widget.
   AEE_EFAILED - If the image could not be set or if the image widget utilizes a model
                 other than the interface model.
Side Effect
Calling IWidget_SetImage() will result in the widget redrawing itself with the new image.
Comment
None
  • Follow