Load bitmap from file.

Namespace:  AForge.Imaging
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public static Bitmap FromFile(
	string fileName
)

Parameters

fileName
Type: System..::.String
File name to load bitmap from.

Return Value

Returns loaded bitmap.

Remarks

The method is provided as an alternative of FromFile(String) method to solve the issues of locked file. The standard .NET's method locks the source file until image's object is disposed, so the file can not be deleted or overwritten. This method workarounds the issue and does not lock the source file.

Sample usage:

CopyC#
Bitmap image = AForge.Imaging.Image.FromFile( "test.jpg" );

See Also