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

Glossary Item Box


Returns/sets the range of the horizontal axis for a control's internal coordinate system. The coordinate system is used for scaling and displaying the image in the control.

Property type

Read-write property


Visual Basic
Public Property ScaleWidth As Long


By default, in ScaleMode 0, this property reflects the portion of the image currently viewable in the control. If the ScaleWidth and/or ScaleHeight properties are set to less than the ImageWidth and/or ImageHeight properties then only a portion of the image will be displayed in the control. The ScaleLeft and ScaleTop properties can be used to scroll the image so another portion is displayed.

All mouse, scroll, and zoom events generated by the control will have coordinates that are relative to the scaling mode in effect.


(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.