version 2003
PA_GetPictureHandleVariable (aVariable; pictInfo) PA_Handle
| Parameter | Type | Description | |
| aVariable | PA_Variable | Variable to access | |
| pictInfo | PA_PictureInfo * | Picture info | |
| Function result | PA_Handle | A handle to the picture data of the variable |
Description
The routine PA_GetPictureHandleVariable returns a handle to the picture data of the variable aVariable. It fills *pictInfo with the picture information. If the variable is not a eVK_Picture variable, the routine returns 0 and leaves pictInfo unchanged.
To get a copy of the data, use PA_GetPictureVariable. It can be useful to only get the Handle for saving memory , especially if the plug-in just want to "read-only" the picture content (sample drawing).
NOTE:
The handle belongs to the variable. Do not dispose of it.
To clear a picture variable, use PA_ClearVariable.
Example
Draw a picture on Macintosh (and Windows + Altura) : the received handle is a regular PicHandle.
void DrawPictureVariable(PA_Variable aVar, Rect *r)
{
PA_Handle h =0L;
PA_PictureInfo info;
h = PA_GetPictureHandleVariable(aVar, &info);
DrawPicture(h, &r);
}
See Also
Error Handling
PA_GetLastError keeps the last error that occurred before calling the routine.