4D v16.3

Pictures

Home

 
4D v16.3
Pictures

Pictures  


 

4D integrates native management of picture formats. 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.

4D uses native APIs to encode and decode pictures (fields and variables) under both Windows and Mac OS. These implementations provide access to numerous native forms, including the RAW format, currently used by digital cameras. 

  • Under Windows, 4D uses WIC (Windows Imaging Component). WIC natively supports the following formats: BMP, PNG, ICO (decoding only), JPEG, GIF, TIFF and WDP (Microsoft Windows Digital Photo).
    It is possible to use additional formats such as JPEG-2000 by installing third-party WIC codecs.
  • Under Mac OS, 4D uses ImageIO. All the available ImageIO codecs are therefore natively supported for decoding (reading) as well as encoding (writing):
    DecodingEncoding
    public.jpegpublic.jpeg
    com.compuserve.gifcom.compuserve.gif
    public.pngpublic.png
    public.jpeg-2000public.jpeg-2000
    com.nikon.raw-imagepublic.tiff
    com.pentax.raw-imagecom.adobe.photoshop.image
    com.sony.arw-raw-imagecom.adobe.pdf
    com.adobe.raw-imagecom.microsoft.bmp
    public.tiff com.canon.crw-raw-imagecom.truevision.tga-image
    com.canon.cr2-raw-imagecom.sgi.sgi-image
    com.canon.tif-raw-imagecom.apple.pict (deprecated)
    com.sony.raw.imagecom.ilm.openexr-image
    com.olympus.raw-image
    com.konicaminolta.raw-image   
    com.panasonic.raw-image    
    com.fuji.raw-image   
    com.adobe.photoshop-image   
    com.adobe.illustrator.ai-image   
    com.adobe.pdf    
    com.microsoft.ico   
    com.microsoft.bmp   
    com.truevision.tga-image   
    com.sgi.sgi-image    
    com.apple.quicktime-image (deprecated)   
    com.apple.icns   
    com.apple.pict (deprecated)   
    com.apple.macpaint-image    
    com.kodak.flashpix-image   
    public.xbitmap-image   
    com.ilm.openexr-image   
    public.radiance    

Under Windows as under Mac OS, the formats supported vary according to the operating system and the custom codecs that are installed on the machines. To find out which codecs are available, you must use the PICTURE CODEC LIST command. 

Note: WIC and ImageIO permit the use of metadata in pictures. Two commands, SET PICTURE METADATA and GET PICTURE METADATA, let you benefit from metadata in your developments.

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

  • As an extension (for example “.gif”)
  • As a Mime type (for example “image/jpeg”)

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.

A specific icon is displayed for pictures saved in a format that is not available on the machine. The extension of the missing format is shown at the bottom of the icon:

The icon is automatically used wherever the picture is meant to be displayed:

This icon indicates that the picture cannot be displayed or manipulated locally -- but it can be saved without alteration so that it can be displayed on other machines. This is the case, for instance, for PDF pictures on Windows, or for pictures based on PICT displayed on a 64-bit 4D Server under OS X.

By default, the picture codecs related to QuickTime are no longer supported in 4D beginning with v14.

For compatibility reasons, you can reactivate QuickTime in your application by means of the QuickTime support option of the SET DATABASE PARAMETER command. However, we no longer recommend using QuickTime codecs.

Note: The QuickTime reactivation option is ignored in 64-bit versions of 4D Developer Edition (no QuickTime support).

4D lets you retrieve the local coordinates of the mouse in a picture field or variable in case of a click or a hovering, even if a scroll or zoom has been applied to the picture. 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.

The 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). If the mouse is outside of the picture coordinates system, -1 is returned in MouseX and MouseY

You can get the value of these variables as part of the On Clicked, On Double Clicked, On Mouse up, On Mouse Enter, or On Mouse Move form events.

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



See also 

Picture Operators
SVG EXPORT TO PICTURE
System Variables

 
PROPERTIES 

Product: 4D
Theme: Pictures

 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)