4D v16.3

CONVERT PICTURE

Home

 
4D v16.3
CONVERT PICTURE

CONVERT PICTURE 


 

CONVERT PICTURE ( picture ; codec {; compression} ) 
Parameter Type   Description
picture  Picture in Picture to be converted
in Converted picture
codec  String in Picture Codec ID
compression  Real in Quality of compression

The CONVERT PICTURE command converts picture into a new type.

The codec parameter indicates the type of picture to be generated. A Codec can be an extension (for example, “.gif”) or a Mime type (for example, “image/jpeg”). You can get a list of Codecs that are available using the PICTURE CODEC LIST command.

If the picture field or variable is a compound type (if, for example, it is the result of a copy-paste action), only the information corresponding to the codec type are preserved in the resulting picture.

Note: If the type of codec requested is the same as the original type of the picture, no conversion is carried out and the picture is returned "as is" (except when the compression parameter is used, see below).

The optional compression parameter, if passed, can be used to specify the compression quality to be applied to the resulting picture when a compatible Codec is used. In compression, pass a value between 0 and 1 to specify the quality of the compression, where 0 is the most mediocre quality (high compression) and 1 the best quality (low compression). This parameter is only taken into account when the Codec supports compression (for example JPEG or HDPhoto) and is supported by the WIC and ImageIO APIs. For more information about picture management APIs in 4D, please refer to the Pictures section. By default, if you omit the compression parameter, the best quality is applied (compression =1).

Conversion of the vpPhoto picture to the jpeg format:

 CONVERT PICTURE(vpPhoto;".jpg")

Conversion of a picture with 60% quality:

 CONVERT PICTURE(vPicture;".JPG";0.6)



See also 

PICTURE CODEC LIST

 
PROPERTIES 

Product: 4D
Theme: Pictures
Number: 1002

 
HISTORY 

Created: 4D v11 SQL
Modified: 4D v12

 
TAGS 

Compression

 
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)