You are here: Start » AVL.NET » AVL.SaveImage_Asynchronous Method

AVL.SaveImage_Asynchronous Method

Saves an image to a file in the background thread.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

public static void SaveImage_Asynchronous(
	ref AvlNet.SaveImageState ioState,
	AvlNet.Image inImage,
	string inFile
)

Parameters

Name Type Range Default Description
ioStateAvlNet.SaveImageStateState containing information about asynchronous execution.
inImageAvlNet.ImageAn image to be saved.
inFilestringPath to a file.

Description

The operation saves an image to file encoded in one of the standard image file formats. Currently the filter supports the following formats:

  • BMP (*.bmp)
  • JPEG (*.jpg, *jpeg)
  • PNG (*.png),
  • TIFF (*.tif, *.tiff).

Because of the limitations of the standard image formats, the filter is capable of saving three-channel images of UInt8 pixel type for all formats, and UInt16 for supported formats only (PNG, TIFF). To alter the format of an image one can use the filters contained in the ImageConversions category.

The inImageFileFormat input can be used to explicitly select the file format to be used. When inImageFileFormat is set to Auto the recognition of the desired image file format is based on the extension of the file being written, so it is essential that the extension is present and accurate.

If the selected file does not exist, it will be created on filter execution. If the selected file does exist, it will be overwritten.

Remarks

This filter is executed in the background thread. Execution errors may be reported with a delay or ignored. Stopping of the program may be delayed, because of waiting for background work to complete.

Errors

Error type Description
DomainError Unsupported pixel type in SaveImage_Asynchronous.

See also