Resources | Resources |



Using bitmap widget

An application can add a bitmap widget to its user interface as follows:

  1. Call ISHELL_CreateInstance() with the AEECLSID_CBitmapWidget ClassID to create a reference counted instance of the bitmap widget.
  2. Call IWidget_SetBitmap() to identify the IBitmap image to be displayed by the widget, passing in a pointer to the IBitmap image to be displayed.
  3. If the bitmap is to be displayed with transparency, call IWidget_SetTranspColor() passing in the RGB value of the transparency color.
The image is displayed with its origin at the top-left corner of the widget's destination rectangle, cropped to the width and height of the widget's extent. The image is neither stretched, shrunk, nor scaled to fit into the destination rectangle. See the for flags that can alter the alignment of the bitmap image within the widget's destination rectangle.

The bitmap widget relies on an interface model that represents its data as a pointer to an IBitmap data structure. The model stores only a pointer to the bitmap, not a copy of the bitmap itself, and should always return this pointer in response to data queries from a client widget.

A default model is created and assigned to the widget when the widget is created with ISHELL_CreateInstance(). The client can replace the widget's model at any time with the method: IWidget_SetModel(), as long as the supplied model interface is of the type that the widget expects.