When the program is driven from an automation script, an options string can be specified in the script that acts as the export options dialogs do in the program. The string consists of comma-separated parameters, which specify the behavior of the various export options.
Parameter |
Type |
Description |
Filter |
string |
GIF |
BackgroundColor |
16777216 = no transparency 16777217 = background transparency 16777215 = white transparency <16777216 = custom color transparency |
If the value is less than 16777216, the color is composed of red, green, and blue and is set to a custom color. The color value is calculated by: Red + Green*256 + Blue*65536 where Red, Green, and Blue are values between 0 and 255. |
ColorDepth |
-32, -16, -8, 1, 4, 8, 24, 32 |
Specifies the color depth to use. ColorDepth=-32 -- 32 bit greyscale output ColorDepth=-16 -- 16 bit greyscale output ColorDepth=-8 -- 8 bit greyscale output ColorDepth=1 -- 1 bit color indexed output ColorDepth=4 -- 4 bit color indexed output ColorDepth=8 -- 8 bit color indexed output ColorDepth=24 -- 24 bit true color output ColorDepth=32 -- 32 bit true color with alpha output |
ColorReductionMethod |
1, 2, 3, 4, 5 |
Specifies the color reduction method to use. ColorReductionMethod=1 -- Use the Ordered Dither color reduction method ColorReductionMethod=2 -- Use the Diffused Dither color reduction method ColorReductionMethod=3 -- Use the Popularity color reduction method ColorReductionMethod=4 -- Use the MedianCut555 color reduction method ColorReductionMethod=5 -- Use the MedianCut888 color reduction method |
HDPI |
integer |
Sets the number of horizontal pixels in the exported image that corresponds to a distance one horizontal inch. Either a Width or an HDPI option may be specified, but not both. The default HDPI is the resolution of the display device driver on your computer (this is 96 dots per inch on many Windows display devices, but number can very from device to device). |
Height |
integer |
Sets the height of the exported image in pixels. Either a Height or a VDPI option may be specified, but not both |
KeepAspect |
0 or 1 |
If this is set to 1, for any of the settings Height, Width, HDPI or VDPI you only need to set one option and Voxler will automatically calculate the other parameters in line with the aspect ratio of the input image. KeepAspect=0 -- Do not retain the aspect ratio KeepAspect=1 -- Do retain the aspect ratio |
KeepPixelSize |
0 or 1 |
Locks the pixel dimension width and height. Changes to the VDPI and HDPI will affect the document size, but not the pixel size, when this is set to 1. Changes to the VDPI and HDPI will affect the pixel dimensions, but not the document size, when this is set to 0. Note that the KeepPixelSize option is ignored if the either the Width or Height option is specified. |
ModuleID |
integer |
Numeric ID of the module to be exported.
0=entire viewer window 2=default |
VDPI |
integer |
Sets the number of vertical pixels in the exported image that corresponds to a distance of one vertical inch. Either a Height or a VDPI option may be specified, but not both. The default VDPI is the resolution of the display device driver on your computer (this is 96 dots per inch on many Windows display devices, but number can very from device to device) |
Width |
integer |
Sets the width of the exported image in pixels. Either a Width or an HDPI option may be specified, but not both. |
Example
This example shows how to export an GIF file with the various options.
CommandApi.Construct("Export")
CommandApi.Option("GuiEnabled", "False")
CommandApi.Option("ClearOptions", "False")
CommandApi.Option("Filter", "gif")
CommandApi.Option("Options", "BackgroundColor=16777215; ColorDepth=32; HDPI=96; Height=418; VDPI=96; Width=576; _
Format=3; Compress=2; UseTransparency=1")
CommandApi.Option("Path", "C:/Path/To/Export/file.gif")
CommandApi.Option("PersistOptions", "True")
CommandApi.Option("ModuleId", "2")
CommandApi.Do()
Used by: Export
See Also