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)

Syntax

C#
public static bool SaveToStream(
	FIBITMAP dib,
	Stream stream,
	FREE_IMAGE_FORMAT format
)
Visual Basic (Declaration)
Public Shared Function SaveToStream ( _
	dib As FIBITMAP, _
	stream As Stream, _
	format As FREE_IMAGE_FORMAT _
) As Boolean
Visual C++
public:
static bool SaveToStream(
	FIBITMAP dib, 
	Stream^ stream, 
	FREE_IMAGE_FORMAT format
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP
Handle to a FreeImage bitmap.
stream
Type: System.IO..::.Stream
The stream to write to.
format
Type: FreeImageAPI..::.FREE_IMAGE_FORMAT
Format of the image.

Return Value

Returns true on success, false on failure.

Exceptions

ExceptionCondition
System..::.ArgumentNullException dib or stream is null.
System..::.ArgumentException stream cannot write.

Version Information

FreeImage.NET

Supported in: 3.11.0, 3.12.0, 3.13.0, 3.13.1

See Also