PA_SetPictureHandleField

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

version 2003


PA_SetPictureHandleField (tNum; fNum; newHPicture)

ParameterTypeDescription
tNumshortTable number of the field to access
fNumshortField number of the field to access
newHPicturePA_HandleNew handle for the picture field

Description

The routine PA_SetPictureHandleField sets the handle of the picture field number fNum of the current record of table number tNum to newHPicture.

If the field is not a picture field, the routine does nothing and sets an error in PA_GetLastError().

This is useful for memory optimisation: PA_SetPicturField duplicates the BLOB, since PA_SetPictureHandleField changes only the value of the handle to the BLOB field.

IMPORTANT NOTE

After the call, the handle belongs to 4th Dimension. Never dispose of it.

Example

Create a new picture and assign it to a field (MacOS or Windows+Altura)

   PicHandle   picture;
   PictureInfo   info = {0, 0, 0};

   picture = OpenPicture(aRect);
   /* . . . draw the picture . . . */
   ClosePicture();

   PA_SetPictureHandleField(tNum, fNum, (PA_Handle) picture, info);
   // Now, picture BELONGS TO 4D

See Also

PA_GetPictureHandleField.

Error Handling

Use PA_GetLastError to see if an error occurred (eER_InvalidFileNumber, eER_InvalidFieldNumber).


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