PA_SetPictureHandleVariable

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_SetPictureHandleVariable (aVariable; hPicture; info)

ParameterTypeDescription
aVariablePA_Variable *Pointer to the variable to access
hPicturePA_HandleNew value of the handle
infoPA_PictureInfoBackground 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

PA_SetPictureVariable.

Error Handling

PA_GetLastError keeps the last error that occurred before calling the routine.


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next