Share via


Visual Basic Reference

Image Property

See Also    Example    Applies To

Returns a handle to a persistent graphic; the handle is provided by the Microsoft Windows operating environment.

Syntax

object.Image

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

An object's AutoRedraw property determines whether the repainting of an object occurs with a persistent graphics or through Paint events. The Windows operating environment identifies an object's persistent graphic 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 the AutoRedraw property. If AutoRedraw is True and nothing has been drawn, the image displays only the color set by the BackColor property and the picture.

You can assign the value of Image to the Picture property. The Image property also provides a value to pass to Windows API calls.

The Image, DragIcon, and Picture properties are normally used when assigning values to other properties, when saving with the SavePicture statement, or when placing something on the Clipboard. You can't assign these to a temporary variable, other than the Picture data type.

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 bitmap returned by Image.