LoadPicture function

xiaoxiao2021-03-05  54

If you load pictures, just care about the first parameter, path.

If it is a cursor and icon file:

LoadPicture function

Load the graph into the form of the Picture property, the PictureBox control or Image control.

grammar

LoadPicture ([FileName], [Size], [ColorDepth], [X, Y])

LoadPicture function syntax has the following sections:

Partial description

FileName is optional. String expressions Specify a file name. Folders and drivers can be included. If the file name is not specified, LoadPicture clears the image or the PictureBox control.

Size optional variant. If FileName is a cursor or icon file, specify the image size you want.

ColorDepth optional variant. If FileName is a cursor or icon file, specify the desired color depth.

X Optional variants, if you use Y, you must use. If FileName is a cursor or icon file, specify the width you want. In a file containing multiple independent images, if the image is not available, the best match can be used. The x and y values ​​are only used when Colordepth is set to VBLPCUSTOM. For icon files 255 is the maximum possible value

Y option variants, if you use X, you must use. If FileName is a cursor or icon file, specify the height you want. In a file containing multiple independent images, if the image is not available, the best match can be used. For icon files 255 is the maximum possible value

Settings

The set value of SIZE is:

Constant value description

VBLPSMall 0 system small icon.

VBLPLARGE 1 system large icon, determined by the video driver.

VBLPSMallshell 2 Case Small Icon Size, Decision Decision on the Caption Buttons on the Appearance tab in the Display Properties dialog box in Control Panel.

VBLPLARGESHELL 3 Housing Large Icon Size, determines the icon size settings on the AppeaRance tab in the Display Properties dialog box in Control Panel.

VBLPCUSTOM 4 Customize, supplies values ​​by x and y parameters.

The set value of ColorDepth is:

Constant value description

VBLPDefault 0 If you use a specified file, you can match the best.

VBLPMONOCHROME 1 2 colors.

VBLPvgacolor 2 16 colors.

VBLPColor 3 256 colors.

Description

Visual Basic's graphics format can be identified is: bitmap (.bmp) file, icon (.CO) file, cursor (.cur) file, stroke encoding (.rle) file, element (.wmf) file, enhanced meta file (.emf), GIF (.gif) files and JPEG (.jpg) files.

The loadPicture that assigns non-parameters will clear the graphics in the form, picture boxes, and image controls.

In order to load the graphic displayed in the PictureBox control and the image control as the form background, the Picture property of the LoadPicture must be assigned to the object to display the object. E.g:

SET PICTURE = loading ("party.bmp")

Set Picture1.Picture = LoadPicture ("party.bmp")

If you want to give the icon to the form, you have to assign the return value of the LoadPicture function to the Icon property of the Form object: set form1.icon = loadingPicture ("Myicon.ico")

The icon can also be given the Dragicon property of other controls other than the Timer control and the MENU control, for example:

SET command1.dragicon = loadingPicture ("Myicon.ico")

Use LoadPicture to load graphics files into the system clipboard as follows:

Clipboard.SetData LoadPicture ("party.bmp")

转载请注明原文地址:https://www.9cbs.com/read-36594.html

New Post(0)