imgSessionSaveBufferEx

NI IMAQ Function

imgSessionSaveBufferEx

Usage

rval imgSessionSaveBufferEx(SESSION_ID sid, const void* buffer, const char* fileName);

Purpose

Saves a buffer to disk in BMP, TIFF, or PNG format.

Parameters

Name Type Direction
sid SESSION_ID input
buffer const void* input
fileName const char* input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

buffer: image to save.

Note  The function takes information, such as bits per pixel and buffer size, from the current session settings. Therefore, this buffer must be associated with the current session.

fileName: filename used to save the image. If the filename has the extension .bmp, the function saves the image as a bitmap file. Bitmap files support 8-bit monochrome and 32-bit RGB color images. If the filename extension is .tif, the function saves the image as a TIFF file. TIFF files support 8-bit monochrome and 32-bit RGB color images. If the filename extension is .png, the function saves the image as a portable network graphics (PNG) file. PNG files support all image types.

Note  If you are saving a 10-, 12-, 14-, or 16-bit monochrome image, use the PNG file format.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.