Saves a previously loaded FreeImage bitmap to a file. The format is taken off the filename. If no suitable format was found false will be returned. Save flags can be provided by the flags parameter.

Namespace:  FreeImageAPI
Assembly:  FreeImageNET (in FreeImageNET.dll)

Syntax

C#
public static bool SaveEx(
	ref FIBITMAP dib,
	string filename,
	FREE_IMAGE_SAVE_FLAGS flags,
	bool unloadSource
)
Visual Basic (Declaration)
Public Shared Function SaveEx ( _
	ByRef dib As FIBITMAP, _
	filename As String, _
	flags As FREE_IMAGE_SAVE_FLAGS, _
	unloadSource As Boolean _
) As Boolean
Visual C++
public:
static bool SaveEx(
	FIBITMAP% dib, 
	String^ filename, 
	FREE_IMAGE_SAVE_FLAGS flags, 
	bool unloadSource
)

Parameters

dib
Type: FreeImageAPI..::.FIBITMAP %
Handle to a FreeImage bitmap.
filename
Type: System..::.String
The complete name of the file to save to. The extension will be corrected if it is no valid extension for the selected format or if no extension was specified.
flags
Type: FreeImageAPI..::.FREE_IMAGE_SAVE_FLAGS
Flags to enable or disable plugin-features.
unloadSource
Type: System..::.Boolean
When true the structure will be unloaded on success. If the function failed and returned false, the bitmap was not unloaded.

Return Value

Returns true on success, false on failure.

Exceptions

ExceptionCondition
System..::.ArgumentNullException dib or filename is null.

Version Information

FreeImage.NET

Supported in: 3.11.0, 3.12.0, 3.13.0, 3.13.1

See Also