Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 8
Extract the image data from a widget in a widget database
#include <Ap.h>
PhImage_t *ApGetImageRes(
ApDBase_t const *dbase,
char const *wgt_name );
- dbase
- The widget database pointer returned from
ApOpenDBase()
or
ApOpenDBaseFile().
- wgt_name
- The name of widget within the database that has the image that you
want to extract.
Ap
ApGetImageRes() lets you extract images from a widget in a
PhAB widget database.
This function is mainly used to perform simple animation.
You can create a series of tiles, using
any widget that supports images,
in a PhAB widget database; to create the animation,
cycle through
the tiles by pulling out the images in sequence,
updating another widget that
is visible within the application window.
A pointer to a PhImage_t structure, or
NULL if the widget or image data couldn't be
found.
|
This function returns a pointer into the widget database;
don't close the database while still using the image.
If you must close the widget database,
you should first use PiDuplicateImage() to make a copy of the image and associated structures.
- Make a copy of the image data, such as image pixel data, alpha channel,
palette, etc, using PiDuplicateImage().
- Update the PhImage_t structure to
point to the new copies of the data.
|
PhImage_t *image;
mydbase = ApOpenDBase( ABM_mypicture );
image = ApGetImageRes( mydbase, "myimage" );
/* update the label widget with the new image */
if ( image ) {
PtSetResource( ABW_label_wgt, Pt_ARG_LABEL_IMAGE,
image, 0 );
}
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
ApOpenDBase(),
ApOpenDBaseFile(),
PgDrawPhImage*(),
PhCreateImage(),
PhImage_t,
PhMakeGhostBitmap(),
PhMakeTransBitmap(),
PhMakeTransparent(),
PhReleaseImage(),
PmMemCreateMC(),
PmMemFlush(),
PxLoadImage()
“Images”
and
“Animation”
in the Raw Drawing and Animation chapter of the
Photon Programmer's Guide
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 183
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apgetimageres.html on line 183