0 out of 1 rated this helpful - Rate this topic

PictureBox.Load Method (String)

Sets the ImageLocation to the specified URL and displays the image indicated.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
public void Load(
	string url
)

Parameters

url
Type: System.String
The path for the image to display in the PictureBox.
Exception Condition
InvalidOperationException

url is null or an empty string.

WebException

url refers to an image on the Web that cannot be accessed.

ArgumentException

url refers to a file that is not an image.

FileNotFoundException

url refers to a file that does not exist.

If the url parameter indicates a local file, the recommended format is a local file path. For example, an image file named myPicture.jpglocated atc:\ would be accessed by passing c:\myPicture.jpg for the url parameter. A full path, such as http://www.contoso.com/path/images/image.jpg, or a relative path, such as ./images/image.jpg, can be used. If a relative path is used, it will be considered relative to the working directory. A call to the Load method sets the ImageLocation property to the value of url.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ