PictureBox.Load Method
Definition
Displays an image in the PictureBox.
Overloads
Load() |
Displays the image specified by the ImageLocation property of the PictureBox. |
Load(String) |
Sets the ImageLocation to the specified URL and displays the image indicated. |
Load()
Displays the image specified by the ImageLocation property of the PictureBox.
public:
void Load();
public void Load ();
member this.Load : unit -> unit
Public Sub Load ()
Exceptions
ImageLocation is null
or an empty string.
See also
Load(String)
Sets the ImageLocation to the specified URL and displays the image indicated.
public:
void Load(System::String ^ url);
public void Load (string url);
member this.Load : string -> unit
Public Sub Load (url As String)
Parameters
- url
- String
The path for the image to display in the PictureBox.
Exceptions
url
is null
or an empty string.
url
refers to an image on the Web that cannot be accessed.
url
refers to a file that is not an image.
url
refers to a file that does not exist.
Remarks
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
.