PA_GetPictureHandleField


version 2003


PA_GetPictureHandleField (tNum; fNum; info) → PA_Handle

Parameter Type Description
tNum short Table number of the field to access
fNum short Field number of the field to access
info PA_PictureInfo* Pointer to picture info
Function result PA_Handle Handle to the picture

Description

The routine PA_GetPictureHandleField returns a handle to the picture data of the field number fNum of the current record of table number tNum . It returns the picture info used when the picture is displayed in the background in *info .

If the field is not a picture field, the routine leaves info unchanged, returns 0 and set an error code in PA_GetLastError .

WARNING

The handle belongs to 4th Dimension. Never dispose of it .

To get a copy of the picture data, use PA_GetPictureField . It is only really useful for getting the Handle for saving memory, especially if the plug-in only wants to view the picture as "read-only".

Example

Draw a picture on Macintosh (and Windows + Mac2Win) : the received handle is a regular PicHandle.

   void DrawPictureField( short tNum, short fNum, Rect *r )
   {
      PA_Handle         h =0L;
      PA_PictureInfo   info;
 
      h = PA_GetPictureHandleField( tNum, fNum, r, &info );
      DrawPicture( (PicHandle) h, &r );
      // Do NOT dispose the picture here, it stills belongs to 4D
   }
 

See Also

PA_GetPictureField , PA_SetPictureField , PA_SetPictureHandleField .

Error Handling

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