PA_SetPictureInArray


version 2003


PA_SetPictureInArray (array; index; newPict; pictSize; info)

Parameter Type Description
array PA_Variable Array to access
index long Index of the element to access
newPict void * Pointer to the new picture data
pictSize long Size of the new picture in bytes
info PA_PictureInfo Background picture info

Description

The routine PA_SetPictureInArray sets the index element of the picture array array to picture .

Pass a pointer to the new picture data in picture , its size in size , and the PictureInfo in info .

Because 4th Dimension uses Macintosh Pictures internally, you must pass a pointer to a valid Macintosh Picture.

A Macintosh Picture starts with 5 short values that gives the size and the rectangle of the picture respectively. Under Windows, these 5 short values need to be byte swapped into the Windows byte order.

If array is not a eVK_ArrayPicture or if index is out of range, the routine does nothing.

Example

Initialize every element of a picture array to a special value, setting the PictureInfo to a default picture.

   void FillPictureArrayWith( PA_Variable arr, void *newPict, long size )
   {
      PA_PictureInfo   info = {0, 0, 0};
      long   count, i;
      count = PA_GetArrayNbElements( arr );
      for ( i = 1; i <= count; i++ )
         PA_SetPictureInArray( arr, i, newPict, size, info);
   }

See Also

PA_GetPictureHandleInArray , PA_GetPictureInArray , PA_SetPictureHandleInArray .

Error Handling

None.