Current location - Loan Platform Complete Network - Big data management - vb call picture code, detailed
vb call picture code, detailed

For example, to make the specified picture displayed in the picture1 picture box:

Picture1.Picture = LoadPicture("e:\tmp\1.jpg")

VB call picture steps are as follows:

1, create an image box, the name is changed to p1,create a command button.

2, double-click the command button, enter the code editor, p1.Picture = LoadPicture("D:\My Documents\New Folder (2)\1.jpg")

3, click Run

4, click the command button, the picture is displayed.

Extension

Returns the picture object.

LoadPicture([filename], [size], [colordepth], [x,y])

The syntax of the LoadPicture function has the following parts:

size Optional variant. If filename is a cursor or icon file, specifies the desired image size.

colordepth Optional variant. If filename is a cursor or icon file, specify the desired color depth.

x Optional variant, required if y is used. If filename is a cursor or icon file, specify the desired width. In files containing multiple separate images, the best possible match is used if images of that size are not available. X and Y values are used only if colordepth is set to vbLPCustom. y Optional variant, mandatory if x is used.

If filename is a cursor or icon file, specify the desired height. In files containing multiple separate images, the best possible match is used if an image of that size is not available.

Files that can be matched are (.emf), BMP (.bmp), GIF (.gif) files, and JPEG (.jpg) files.