Loads a .NET Bitmap from a file.

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

Syntax

C#
public static Bitmap LoadBitmap(
	string filename,
	FREE_IMAGE_LOAD_FLAGS flags,
	ref FREE_IMAGE_FORMAT format
)
Visual Basic (Declaration)
Public Shared Function LoadBitmap ( _
	filename As String, _
	flags As FREE_IMAGE_LOAD_FLAGS, _
	ByRef format As FREE_IMAGE_FORMAT _
) As Bitmap
Visual C++
public:
static Bitmap^ LoadBitmap(
	String^ filename, 
	FREE_IMAGE_LOAD_FLAGS flags, 
	FREE_IMAGE_FORMAT% format
)

Parameters

filename
Type: System..::.String
Name of the file to be loaded.
flags
Type: FreeImageAPI..::.FREE_IMAGE_LOAD_FLAGS
Flags to enable or disable plugin-features.
format
Type: FreeImageAPI..::.FREE_IMAGE_FORMAT %
Format of the image. If the format should be taken from the filename use FIF_UNKNOWN.

Return Value

The loaded .NET Bitmap.

Exceptions

ExceptionCondition
System.IO..::.FileNotFoundException filename does not exists.
System..::.ArgumentException The image type of the image is not FIT_BITMAP.

Version Information

FreeImage.NET

Supported in: 3.11.0, 3.12.0, 3.13.0, 3.13.1

See Also