Click or drag to resize
Accord.NET (logo)

ImageFromFile Method

Load bitmap from file.

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.6.0
Syntax
public static Bitmap FromFile(
	string fileName
)
Request Example View Source

Parameters

fileName
Type: SystemString
File name to load bitmap from.

Return Value

Type: Bitmap
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:

Bitmap image = Accord.Imaging.Image.FromFile( "test.jpg" );
See Also