| ![[Previous]](../image-lib/prev.gif) | ![[Contents]](../image-lib/contents.gif) | ![[Index]](../image-lib/keyword_index.gif) | ![[Next]](../image-lib/next.gif) | 
Free a bitmap resource structure
void ApFreeBitmapRes (ApBitmap_t *bitmap);
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.
|  | 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. | 
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);
Photon
| Safety: | |
|---|---|
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | No | 
Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide
| ![[Previous]](../image-lib/prev.gif) | ![[Contents]](../image-lib/contents.gif) | ![[Index]](../image-lib/keyword_index.gif) | ![[Next]](../image-lib/next.gif) |