imaqWriteVisionFile

NI Vision for LabWindows/CVI Function

imaqWriteVisionFile

Usage

int imaqWriteVisionFile(const Image* image, const char* fileName, const RGBValue* colorTable);

Purpose

This function writes an image to a PNG file. In addition to writing pixel information, the function writes any Vision information contained in the image to the file.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_U16, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

image const Image* The image to write to a file.
fileName const char* The name of the file to write. This parameter is required and cannot be NULL.
colorTable const RGBValue* An optional color table to associate with 8-bit images. If you provide a color table, the table must have 256 elements. Set this parameter to NULL to write a grayscale palette to the image.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().