PixelToPercentage Method Example

The following example converts the Top, Left, Height and Width coordinates from 30, 30, 100, 150 in pixels to percentage of screen space available for the Picture TestPicture.

Dim dTop As Double

Dim dLeft As Double

Dim dHeight As Double

Dim dWidth As Double

dTop = 30

dLeft = 30

dHeight = 100

dWidth = 150

TestPicture.PixelToPercentage dTop, dLeft, dHeight, dWidth