See Also Example
Applies To
Form, picture box
Description
Specifies a handle Not available at design time; read-only at run time.
Usage
[form.][picturebox.]Image
Remarks
This property is a Microsoft Windows environment bitmap handle.
An object's AutoRedraw The operating environment identifies an object's persistent bitmap by assigning a handle to it; you can use the Image property to get this handle.
An Image value exists regardless of the setting for AutoRedraw. If AutoRedraw is True and nothing has been drawn, the image contains only the color set with the BackColor property and the picture.
You can assign the value of Image to the Picture The Image property also provides a value to pass to Windows API calls.
The Image, DragIcon You cannot assign these to temporary variables and then use the results.
The AutoRedraw property can cause Image, which is a handle to a bitmap, to change. When AutoRedraw is True, an object's hDC property becomes a handle to a device context that contains the Image bitmap.
Data Type
Integer
Help:
AutoRedraw Property
BackColor Property
DragIcon Property
Paint Event
Picture Property
SavePicture Statement
Programmer's Guide:
Chapter 16, "Displaying and Printing Information"
The example draws a circle in the first picture box each time you click it. When you click the second picture box, the picture from the first picture box is copied into it. To try this example, paste the code into the Declarations section of a form that has two large, equal-sized picture box controls. Press F5 to run the program and then click the picture box controls.
Form_Load ()
Picture1.AutoReDraw = True ' Set AutoRedraw True.
End Sub
Sub Picture1_Click ()
Dim PW, PH ' Declare variables.
Picture1.FillStyle = 0 ' Set FillStyle to solid.
Picture1.FillColor = QBColor(Int(Rnd * 15)) ' Choose random color.
PW = Picture1.ScaleWidth ' Set ScaleWidth.
PH = Picture1.ScaleHeight ' Set ScaleHeight.
' Draw a circle in random location.
Picture1.Circle (Int(Rnd * PW), Int(Rnd * PH)), 250
End Sub
Sub Picture2_Click ()
Picture2.Picture = Picture1.Image ' Copy Image to Picture2.
End Sub