WriteJPEG2000File Method
Syntax
CWIMAQVision.WriteJPEG2000File SourceImage, Path [, Lossless = True] [, CompressionRatio = 50] [, AdvancedOptions] [, ColorPalette]
Return Type
On success, this method returns 0. On failure, this method returns a negative number.
Purpose
Writes an image to a file in JPEG2000 format.
Remarks
Use this method with U8, U16, I16, RGB32, and RGBU64 images.
Parameters
SourceImage As CWIMAQImage
The image to write to a file.
Path As String
The name of the file.
Lossless As Variant
[Optional] Set this parameter to True to write the JPEG2000 file without loss of information. Set this parameter to False to write the JPEG2000 file as an approximation to the image.
This parameter has a default value of True.
CompressionRatio As Variant
[Optional] Specifies the degree to which to compress the JPEG2000 file as a Single. For example, a CompressionRatio of 50 means that the resulting JPEG2000 file will be 50 times smaller than the size of the image in memory. This parameter is ignored if lossless is True.
This parameter has a default value of 50.
AdvancedOptions As Variant
[Optional] A CWIMAQJPEG2000FileAdvancedOptions object that specifies the advanced options to use when writing the file.
ColorPalette As Variant
[Optional] A color table to associate with U8 images. The default is a grayscale palette. If the color table has less than 256 elements, the function fills the remaining elements with grayscale values to increase the size of the color table to 256 elements.