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

Glossary Item Box

Description

Returns/sets the horizontal image coordinate that is mapped to the left edge of the control.

Property type

Read-write property

Syntax

Visual Basic
Public Property ScaleLeft As Long

Remarks

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 horizontal scrollbar is manipulated by the user.

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.