In Picture box You can also load the picture at runtime using the . . . . . . . . method.

picture box
load picture
resize
text

The correct answer is B. load picture.

The LoadPicture method loads an image file into a PictureBox control. The syntax for the LoadPicture method is:

LoadPicture(filename, [imageindex])

The filename argument is the path and file name of the image file to load. The imageindex argument is the index of the image to load. If the imageindex argument is omitted, the first image in the file is loaded.

The LoadPicture method returns a Picture object that represents the loaded image. The Picture object can then be used to set the Image property of the PictureBox control.

The following code example shows how to load an image file into a PictureBox control:

Dim myPicture As PictureBox = New PictureBox()
myPicture.Image = LoadPicture("c:\images\myimage.jpg")
myPicture.Location = New Point(100, 100)
myPicture.Size = New Size(200, 200)

The above code example will load the image file “c:\images\myimage.jpg” into the PictureBox control named “myPicture”. The image will be displayed at the position (100, 100) on the form, and it will have a size of 200 x 200 pixels.

The other options are incorrect because they do not represent a method that can be used to load an image file into a PictureBox control.

Exit mobile version