[Previous] [Contents] [Index] [Next]

ApFreeBitmapRes()

Free a bitmap resource structure

Synopsis:

void ApFreeBitmapRes (ApBitmap_t *bitmap);

Description:

This function frees a bitmap resource structure returned by ApGetBitmapRes(). It doesn't free the bitmap planes or colors because they point back into the widget database.


Note: You can't change the number of planes in a PtBitmap widget unless the Pt_FREE_MEMORY flag is set in the widget's Pt_ARG_FLAGS resource. If you set this flag in conjunction with ApGetBitmapRes(), you must make a copy of the data before setting the resources, so that bitmap data isn't freed from the widget database.

Examples:

ApBitmap_t *bitmap;

bitmap = ApGetBitmapRes (db, "icon");
PtSetArg (&args[0], Pt_ARG_BITMAP_COLORS, bitmap->colors,
          bitmap->nplanes);
PtSetArg (&args[1], Pt_ARG_BITMAP_DATA, bitmap->data, 0);
PtSetResources (ABW_bitmap_wgt, 2, args);
ApFreeBitmapRes (bitmap);

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApBitmap_t, ApGetBitmapRes()

Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]