←Select platform

CurrentXScaleFactor Property

Summary

Gets the current horizontal scale factor

Syntax

C#
VB
C++
public double CurrentXScaleFactor { get; } 
  
Public ReadOnly Property CurrentXScaleFactor As Double 
public: 
property double CurrentXScaleFactor { 
   double get(); 
} 

Property Value

The current horizontal scale factor. Default value is 1.0

Remarks

The CurrentXScaleFactor and CurrentYScaleFactor properties will always contain the current horizontal and vertical scale factors used to calculate the current display properties of the image in the control.

The following properties determine the final transformation of the image:

  • The control size

  • The image physical size in pixels and if using the image resolution is enabled with the UseDpi property

  • Any manual correction with the AspectRatioCorrection

  • The current zoom using the ScaleFactor property

  • The current display and automatic adjustment set with the SizeMode property

  • Image viewing transformation using the Flip, Reverse and RotateAngle properties

You can use the Transform property to calculate where a location or bounds on the image will be displayed on the control and vice versa using the Matrix.Transform methods, you can easily achieve this task with the control PointToImageCoordinates, BoundsToImageCoordinates, PointFromImageCoordinates and BoundsFromImageCoordinates methods

The CurrentXScaleFactor and CurrentYScaleFactor properties are read-only and cannot be changed by the user. To set a uniform scaling factor into the control, use the ScaleFactor property. To set a non-uniform scale factor in the control use the AspectRatioCorrection property.

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
public void ImageBox_CurrentXScaleFactor(ImageBox viewer) 
{ 
   viewer.SizeMode = SizeMode.Fit; 
 
   string s = string.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor); 
   MessageBox.Show(s); 
} 
Imports Leadtools.Windows.Controls 
 
Public Sub ImageBox_CurrentXScaleFactor(ByVal viewer As ImageBox) 
   viewer.SizeMode = SizeMode.Fit 
 
   Dim s As String = String.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor) 
   MessageBox.Show(s) 
End Sub 
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
public void ImageBox_CurrentXScaleFactor(ImageBox viewer) 
{ 
   viewer.SizeMode = SizeMode.Fit; 
 
   string s = string.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor); 
   MessageBox.Show(s); 
} 
Imports Leadtools.Windows.Controls 
 
Public Sub ImageBox_CurrentXScaleFactor(ByVal viewer As ImageBox) 
   viewer.SizeMode = SizeMode.Fit 
 
   Dim s As String = String.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor) 
   MessageBox.Show(s) 
End Sub 

Requirements

Target Platforms

See Also

Reference

ImageBox Class

ImageBox Members

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Controls Assembly