LEADTOOLS WPF and Silverlight (Leadtools.Windows.Controls assembly)
LEAD Technologies, Inc

CurrentXScaleFactor Property (ImageViewer)

Example 





Gets the current horizontal scale factor .NET support Silverlight support
Syntax
public double CurrentXScaleFactor {get;}
'Declaration
 
Public ReadOnly Property CurrentXScaleFactor As Double
'Usage
 
Dim instance As ImageViewer
Dim value As Double
 
value = instance.CurrentXScaleFactor
public double CurrentXScaleFactor {get;}
 get_CurrentXScaleFactor(); 
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:

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
Copy CodeCopy Code  
Public Sub ImageViewer_CurrentXScaleFactor(ByVal viewer As ImageViewer)
    viewer.SizeMode = SizeMode.Fit
    Dim s As String = String.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor)
    MessageBox.Show(s)
End Sub
public void ImageViewer_CurrentXScaleFactor(ImageViewer viewer)
{
   viewer.SizeMode = SizeMode.Fit;
   string s = string.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor);
   MessageBox.Show(s);
}
public void ImageViewer_CurrentXScaleFactor(ImageViewer viewer)
{
   viewer.SizeMode = SizeMode.Fit;
   string s = string.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor{1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor);
   MessageBox.Show(s);
}
Public Sub ImageViewer_CurrentXScaleFactor(ByVal viewer As ImageViewer)
   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: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ImageViewer Class
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.