|
![]() |
![]() |
version 2003
PA_SetPictureHandleVariable (aVariable; hPicture; info)
Parameter | Type | Description | |
aVariable | PA_Variable * | → | Pointer to the variable to access |
hPicture | PA_Handle | → | New value of the handle |
info | PA_PictureInfo | → | Background picture info |
Description
The routine
PA_SetPictureHandleVariable
sets the handle of the variable pointed to by
aVariable
to the handle
hPicture
. In addition, pass the
PA_PictureInfo
in
info
(used when the picture is in a background position).
This is useful for memory optimization:
PA_SetPictureVariable
duplicates the picture, since
PA_SetPictureHandleVariable
changes only the value of the handle to the picture data.
WARNING
The kind of of the variable pointed to by
aVariable
is set to
eVK_Picture
by the routine, even if it was not its previous kind.
Make sure not to change 4D variable kinds (using
PA_GetVariable
), especially in compiled mode.
IMPORTANT NOTE
After the call, the handle belongs to the variable.
Example
Wrapper that checks the kind and uses empty picture info.
void mySetPictureHandleVariable(PA_Variable *v, PA_Handle h)
{
if(PA_GetVariableKind(*v) == eVK_Picture)
{
PA_PictureInfo info = {0, 0, 0};
PA_SetPictureHandleVariable(v, h, info);
}
}
See Also
Error Handling
keeps the last error that occurred
before
calling the routine.