Pictures

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11 (Modified)


Native Formats Supported

4D integrates native management of the most current picture formats, such as JPEG or GIF. This means that pictures will be displayed and stored in their original format, without any interpretation in 4D. The specific features of the different formats (shading, transparent areas, etc.) will be retained when they are copied and pasted, and will be displayed without alteration. This native support is valid for all pictures stored in 4D: library pictures, pictures pasted into forms in Design mode, pictures pasted into fields or variables in Application mode, etc.

The native formats are available in all cases and will always be returned by the PICTURE CODEC LIST command, regardless of the operating system and machine configuration. These formats are the following:

Jpeg

Png

Bmp

Gif

Tif

Emf (Windows only)

Pict

Svg

Pdf (Mac OS only)

Note: If 4D cannot interpret the picture format, the program calls on Quicktime routines (see below).

Picture Codec IDs

Picture formats recognized by 4D are returned by the PICTURE CODEC LIST command as picture Codec IDs. They can be returned in three different forms:

As an extension (for example ".gif")

As a Mime type (for example "image/jpeg")

As a 4-character QuickTime code (for example "PNTG")

The form returned for each format will depend on the way the Codec is recorded at the operating system level.

Most of the 4D picture management commands can receive a Codec ID as a parameter. It is therefore imperative to use the system ID returned by the PICTURE CODEC LIST command.

Coordinates for Clicks on a Picture


4D lets you retrieve the local coordinates of a click on a picture field or variable, even if a scroll or zoom has been applied to the picture.

The click coordinates are returned in the MouseX and MouseY system variables. The coordinates are expressed in pixels with respect to the top left corner of the picture (0,0). You must get the value of these variables as part of the On Clicked or On Double Clicked form event. In order for this mechanism to work properly, the display format must be set to "Truncated non-centered" (see the SET FORMAT command).

This mechanism, similar to that of a picture map, can be used, for example, to handle scrollable button bars or the interface of cartography software.

Using Apple QuickTime with 4D


4D can use Apple QuickTime routines to manage picture storage and display in databases.

Under Mac OS, QuickTime is integrated into the operating system, no extension is required.

Under Windows, 4D requires QuickTime version 4 (or higher) to be installed in order for you to be able to use picture compression/decompression on this platform.

Compatibility Note: The LOAD COMPRESS PICTURE FROM FILE, COMPRESS PICTURE FILE and COMPRESS PICTURE commands call upon obsolete mechanisms. They can be favorably replaced by the WRITE PICTURE FILE, PICTURE TO BLOB or CONVERT PICTURE commands. Moreover, commands that call on disk files (LOAD COMPRESS PICTURE FROM FILE and COMPRESS PICTURE FILE) will not work under Windows, no matter what version of QuickTime is installed.

Picture Conversion and Compression Errors

When you try to use a picture conversion or compression command and QuickTime is not installed in your system, 4D returns the error code -9955. Other errors generated by QuickTime can also be returned. You can catch these errors using an error-handling method installed with ON ERR CALL.

Picture Operators


4D allows you to carry out operations on 4D pictures, such as concatenation, superimposing, etc. This point is covered in the Picture Operators section.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next