Developer

API Reference

ICanvas

Brew Release
Brew MP 1.0.2
See Also
IDisplay interface IRootContainer interface
Description
The ICanvas interface provides a drawing surface for widgets and other components to draw upon.
The following APIs are provided to support an object reference counting mechanism for objects to manage their own memory instances.
       ICanvas_AddRef()
       ICanvas_Release()

The following API is provided to support run-time interface polymorphism.
       ICanvas_QueryInterface

The following APIs are provided to retrieve or set the destination bitmap for the draw operation. Drawing is achieved by using native IBitmap interface methods.
       ICanvas_GetBitmap()
       ICanvas_SetBitmap()

The following APIs are provided to retrieve or set the clipping rectangle.
       ICanvas_GetClipRect()
       ICanvas_SetClipRect()

Required header files:
   AEEBitmap.h

Usage
ICanvas is used in conjunction with IDisplay and IRootContainer. Typically at the startup of the application, you get an ICanvas. Then you set an IDisplay using IDisplayCanvas_SetDisplay(). Finally you set the ICanvas to your Root Container using IRootContainer_SetCanvas(). This way the root container (and any widgets contained in it) can actually display to the screen.
Example code -
   ISHELL_CreateInstance(piShell, AEECLSID_DisplayCanvas, 
            (void**)&piCanvas) );
   IDisplayCanvas_SetDisplay(piCanvas, piDisplay) );
   IRootContainer_SetCanvas(picRoot, (ICanvas*) (void*) piCanvas, 
         &rcContainer);
  • Follow