Returns an image's actual width in pixels.

Syntax

<oRef>.imgPixelWidth

<oRef>

A reference to an image object.

Property of

Image

Description

The imgPixelWidth property is readonly and returns the actual width of the image currently loaded into an image object.

When no image is loaded into an image object, the imgPixelWidth property returns 0 (the default).

The imgPixelWidth property can be used with the imgPixelHeight property to retrieve the actual size of an image in pixels.

The image object's height and width properties can then be set to display the image at its actual size without either clipping part of the image or scaling the image to fit the image object.