PA_SetPictureVariable

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

version 2003


PA_SetPictureVariable (aVariable; newPicture; pictSize; info)

ParameterTypeDescription
aVariablePA_Variable *Pointer to the variable to access
newPicturevoid *Data of the new picture
pictSizelongPicture size in bytes
infoPA_PictureInfoPicture info

Description

The routine PA_SetPictureVariable sets the content of the variable pointed to by aVariable to the data pointed to by newPicture.

Pass a pointer to the data of the picture in newPicture, the size in bytes of the picture in pictSize , and picture info in info (used when the picture is in the background).

WARNING

The kind of of the variable pointed to by aVariable is set to eVK_Pictureb by the routine, even if it was not its previous kind.

Make sure that you do not change 4D variable kinds (using PA_GetVariable), especially in compiled mode.

Note that PA_SetPictureVariable duplicates newPicture, which still belongs to the plug-in after the call. To give the data without duplicating it, use PA_SetPictureHandleVariable.

Example

Wrapper that checks the kind and uses empty picture info.

   void mySetPictureVariable(PA_Variable *v, void *p, long s)
   {
      if(PA_GetVariableKind(*v) == eVK_Picture)
      {
         PA_PictureInfo info = {0, 0, 0};
         PA_SetPictureVariable(v, p, s, info);
      }
   }

See Also

PA_SetPictureHandleVariable.

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