QPix Command Reference Image Files |

### QPx_ReadImageFileInPicture

QPx_ReadImageFileInPicture(imagePath; imagePict):error
| imagePath | Text | Full path to image file
| imagePict | Picture | 4D picture variable
| error | Longint | Error result

Reads an image file into a 4D picture variable.

The image file is specified by imagePath. If it contains a valid image, it will be converted to a QuickDraw picture and returned in the imagePict parameter.

If imagePath is empty, QPix presents a file selection dialog where the user can preview and select an image file. If the user selects a file, its full pathname is returned in imagePath, otherwise error qpx_userCancelErr is returned.

Warning: Graphic files can be very big, depending on image dimensions, resolution and pixel depth. Before reading image files into 4D pictures, make sure there is enough memory available to 4D to avoid crashes and data loss.

Example

``Get an image into a 4D picture` ``The user is asked for the image file` `` `C_LONGINT($error)` `C_TEXT($imagePath)` `C_PICTURE($pict)` `` `$imagePath:="" `This will bring up the file selection dialog` `` `$error:=QPx_ReadImageFileInPicture ($imagePath;$pict)` `` `If ($error#qpx_noErr)` ``Handle the error` `End if`

QPix © Escape Information Services
Generated by QDoc 2.6 on Thu, 2 May 2002 00:49:49 +0300