CREATE THUMBNAIL

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.7


CREATE THUMBNAIL (source; dest{; width{; height{; mode{; depth}}}})

ParameterTypeDescription
sourcePicture4D picture field or variable to convert as a thumbnail
destPictureResulting thumbnail
widthIntegerThumbnail width in pixels, Default value = 48
heightIntegerThumbnail height in pixels, Default value = 48
modeIntegerThumbnail creation mode
Default value = Scaled to fit prop centered (6)
depthIntegerThumbnail colors in bits/pixels
Default value = Current screen depth (0)

Description

The CREATE THUMBNAIL command returns a thumbnail from a given source picture. Thumbnails are usually used for picture preview within multimedia software or Web sites.

Note: This command does not require QuickTime installation.

You pass in the source parameter the 4D variable or field containing the picture to reduce to a thumbnail. You pass in the dest parameter the 4D picture field or variable which should host the resulting thumbnail.

The optional parameters width and height define the required thumbnail size (in pixels). If you omit these parameters, the thumbnail default size will be 48 x 48 pixels.

The optional parameter mode defines the thumbnail creation mode, i.e. the reduction mode. Three modes are available. The following predefined constants are provided by 4th Dimension in the "Picture Display Formats" constant theme:

Constants Type Value
Scaled to fitLong integer2
Scaled to fit proportionalLong integer5
Scaled to fit prop centeredLong integer6 (default)

Note: Only these constants can be used with CREATE THUMBNAIL. The other constants in the theme "Picture Display Formats" cannot be applied to this command.

If you do not enter any parameter, the "Scaled to fit prop centered" mode (6) is applied by default. Below is an illustration of the various modes:

Source picture

Resulting thumbnails (48x48)

Scaled to fit = 2

Scaled to fit proportional = 5

Scaled to fit prop centered = 6 (default mode)

Note: With the "Scaled to fit proportional" and the "Scaled to fit prop centered", the free space will be displayed in white. When these modes are applied to picture field or variable in 4D forms, the free space is transparent.

The optional parameter depth defines the number of colors under Mac OS (i.e., the screen depth) to keep for the resulting thumbnail. The parameter is an integer equal to the number of bits per pixel: 1, 2, 4, 8, 16 or 32. Enter 0 to use the current screen depth (default value).

Note: Under Windows, the depth parameter is ignored; the command always uses the current screen depth.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next