PA_GetPictureHandleVariable

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

version 2003


PA_GetPictureHandleVariable (aVariable; pictInfo) PA_Handle

ParameterTypeDescription
aVariablePA_VariableVariable to access
pictInfoPA_PictureInfo *Picture info
Function resultPA_HandleA 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

PA_GetPictureVariable.

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