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 |
ApBitmap_t,
ApGetBitmapRes()