Creates an Image from the specified file.
Public Shared Function FromFile ( _ filename As String _ ) As Image
Dim filename As String Dim returnValue As Image returnValue = Image.FromFile(filename)
public static Image FromFile( string filename )
public: static Image^ FromFile( String^ filename )
public static function FromFile( filename : String ) : Image
The file does not have a valid image format.
-or-
GDI+ does not support the pixel format of the file.
The specified file does not exist.
filename is a Uri.
The file remains locked until the Image is disposed.
If the file does not have a valid image format or if GDI+ does not support the pixel format of the file, this method throws an OutOfMemoryException exception.
The Image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98