See Also Example
Form, picture box.
Specifies a handle Not available at design time; read-only at run time. to a persistent bitmap ; the handle is provided by the system.
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. property determines whether the repainting of an object occurs with a persistent bitmap or through Paint events.
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. property.
The Image, DragIcon You cannot assign these to temporary variables and then use the results., and Picture properties must be used directly when assigning values to other properties, when saving with the SavePicture statement, or when placing something onto the Clipboard .
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.
Chapter 16, "Displaying and Printing Information"
Image Property Example
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.
Picture1.AutoReDraw = True ' Set AutoRedraw True.
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
Sub Picture2_Click ()
Picture2.Picture = Picture1.Image ' Copy Image to Picture2.