ImageMan ActiveX Control Version 8
ScaleTop Property
See Also  Example  Send comments on this topic.

Glossary Item Box


Returns/sets the vertical image coordinate that is mapped to the top edge of the control.

Property type

Read-write property


Visual Basic
Public Property ScaleTop As Long


Modifying this property will affect which portion of the image is displayed in the control. Changing these coordinates will cause the image to be scrolled in the control. This property is automatically updated as the vertical scrollbar is manipulated by the user.


(Visual Basic)Copy Code
'Show the whole image in the control without maintaining aspect ratio
ImageControl1.AutoScale = NoScale
ImageControl1.ScaleWidth = ImageControl1.ImageWidth
ImageControl1.ScaleHeight = ImageControl1.ImageHeight

'Show Only the bottom quarter of image
ImageControl1.ScaleLeft = ImageControl1.ImageWidth / 2
ImageControl1.ScaleTop = ImageControl1.ImageHeight / 2

'Show the entire image inside control, while maintaining aspect ratio
Dim xMag, yMag
ImageControl1.AutoScale = NoScale

xMag = ImageControl1.ScaleWidth / ImageControl1.ImageWidth
yMag = ImageControl1.ScaleHeight / ImageControl1.ImageHeight
If xMag > yMag Then
    ImageControl1.ScaleWidth = ImageControl1.ScaleWidth / yMag
    ImageControl1.ScaleHeight = ImageControl1.ScaleHeight / yMag
    ImageControl1.ScaleWidth = ImageControl1.ScaleWidth / xMag
    ImageControl1.ScaleHeight = ImageControl1.ScaleHeight / xMag
End If


See Also

© 2014 Data Techniques Inc. All Rights Reserved.