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

Glossary Item Box

Description

Returns/sets the range of the vertical 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

Syntax

Visual Basic
Public Property ScaleHeight As Long

Remarks

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.

Example

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


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

'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
Else
    ImageControl1.ScaleWidth = ImageControl1.ScaleWidth / xMag
    ImageControl1.ScaleHeight = ImageControl1.ScaleHeight / xMag
End If

ImageControl1.Refresh

See Also

© 2014 Data Techniques Inc. All Rights Reserved.