FreeImage.SaveToStream Method (FIBITMAP, Stream, FREE_IMAGE_FORMAT, FREE_IMAGE_SAVE_FLAGS, Boolean)

FreeImage.NET

FreeImageSaveToStream Method (FIBITMAP, Stream, FREE_IMAGE_FORMAT, FREE_IMAGE_SAVE_FLAGS, Boolean)
Saves a previously loaded FreeImage bitmap to a stream. The stream must be set to the correct position before calling SaveToStream.

Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
Syntax
C#
public static bool SaveToStream(
	ref FIBITMAP dib,
	Stream stream,
	FREE_IMAGE_FORMAT format,
	FREE_IMAGE_SAVE_FLAGS flags,
	bool unloadSource
)

Parameters

dib
Type: FreeImageAPIFIBITMAP
Handle to a FreeImage bitmap.
stream
Type: System.IOStream
The stream to write to.
format
Type: FreeImageAPIFREE_IMAGE_FORMAT
Format of the image.
flags
Type: FreeImageAPIFREE_IMAGE_SAVE_FLAGS
Flags to enable or disable plugin-features.
unloadSource
Type: SystemBoolean
When true the structure will be unloaded on success.

Return Value

Type: Boolean
Returns true on success, false on failure.
Exceptions
ExceptionCondition
ArgumentNullExceptiondib or stream is null.
ArgumentExceptionstream cannot write.
See Also