AP Read Picture File

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

version 6.5 (Modified)


AP Read Picture File (file; imageVar) Integer

ParameterTypeDescription
fileStringPathname to PICT document
imageVarPicture4D picture variable that will contain the read picture
Function resultInteger0, if the operation was successful;
otherwise a system error code

Description

AP Read Picture File loads into the imageVar picture variable the picture contained in the PICT document whose pathname is passed in the file parameter.

If the operation is completed successfully, the function returns 0; otherwise it returns a negative error code (i.e., -43 for file not found).

Note: This command recognizes the image format regardless of the file extension (under Windows).

This command can read files in the following formats:

On both Windows and Macintosh

BMP files

This bitmap format is converted to PICT format within 4D. Pictures are then available for display on both platforms. Supported subformats are black and white, 16 colors, 256 colors, 24 and 32 bits. RLE compression and 16-bit color are not supported.

JPEG files

This file format enables a high level of compression for photographic pictures. AP Read Picture File generates a PICT image with no compression. It does not require QuickTime to be installed. It generates a 24-bit or 256 grayscale level that can be displayed on both platforms.

Note: JPEG pictures are stored using a high compression level. Unpacking and uploading them may require a large amount of memory, even if the JPEG file is small. If the memory allocated to 4D is low, you should take this into account. In Windows, the memory temporarily allocated to unpacking is withdrawn from the memory allocated to the system. For such an operation to be successful, your machine must have enough memory. The size of the memory buffer allocated to unpacking is defined as follows: 3 X Width X Height. The resulting PICT image will have approximately the same size.

GIF files

This file format is converted to PICT inside 4D. Therefore, images are correctly displayed on both Macintosh and Windows platforms. Usable formats are: black and white, 16 and 256 colors. This format is often used to publish images on the Web.

PICT files uncompressed or compressed with QuickTime

PICT is the standard picture format on the Macintosh; all Macintosh drawing applications should be able to export images in PICT format. These files can be generated from a Macintosh or Windows application such as PhotoShop or CorelDraw. Using PICT format inside a database allows you to view these images on both Macintosh and Windows. On Windows, the PICT file extension is either .PIC or .PCT.

On Windows only

WMF files (Windows Metafile)

These files must be "positionable" files, and include a header describing the picture size and its resolution. If no header is available, the command will not be able to read the picture file. WMF files are to the Windows platform what PICT files are to the Mac OS platform; they can contain both vectorial and bitmap data (drawing and painting) that correspond to each system. The two main advantages of WMF files on Windows are the faster display speed (no conversion is required) and their universal use. All Windows applications can export in this format. However, keep in mind that using this format prevents you from displaying the pictures on the Macintosh platform.

EMF files (Windows Enhanced Metafile)

This format is an improvement on WMF. Future Windows applications are likely to support it. The main advantages of this format are enhanced basic elements, such as Beziers and transformations.

Note: If you import EMF or WMF images, they will not be displayed on a Macintosh.


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