Finance

Charts

Statistics

Macros

Search

Image with Excel VBA

The Image control is used to display graphic files in BMP, CUR, GIF, ICO, JPG, and WMF formats.
Table lists the main properties of the Image control.

Table. Properties of the Image control

Property Description
AutoSize Takes Boolean values and determines whether the object should automatically resize to fit the entire image.
Picture Sets the displayed graphic file. Used with the LoadPicture function.
PictureSizeMode Sets the image scaling mode. Valid values: fmPictureSizeModeClip (the parts of the image that do not fit into the control’s boundaries are clipped), fmPictureSizeModeStretch (the image is scaled to occupy the entire control area), fmPictureSizeModeZoom (the image is scaled proportionally so that it fits entirely inside the control).
PictureAlignment Sets the alignment of the image inside the control. Valid values: fmPictureAlignmentTopLeft, fmPictureAlignmentTopRight, fmPictureAlignmentCenter, fmPictureAlignmentBottomLeft, fmPictureAlignmentBottomRight.
PictureTiling Takes Boolean values and determines whether the object should be tiled with the image.

About window
The Image control is often used when creating About windows to insert raster images.

The following project demonstrates such use.

To implement it, create a window with an image and two labels. You will also need a raster file containing your or another image.

Make sure the required graphic file is located in the default directory used by MS Excel.

In the form module, type the necessary code.
Note that different font settings are used in the labels to give the window a more professional appearance.

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx