←Select platform

ScaleFactor Property

Summary

Gets or sets the zoom factor used to display the image. This is a dependency property.

Syntax

C#
VB
C++
public double ScaleFactor { get; set; } 
  
Public Property ScaleFactor As Double 
public: 
property double ScaleFactor { 
   double get(); 
   void set (    double ); 
} 

Property Value

The zoom factor used to display the image. A value of 1.0 means 100 percent, a value of 1.5 means 150 percent, a value of 2.0 = 200 percent and so on. Default value is 1.0

Remarks

When the value of SizeMode is set to SizeMode.Normal, you can use the ScaleFactor property to zoom in and out of the image. Values greater than 1.0 will zoom the image in, values less than 1.0 will zoom the image out.

When the value of SizeMode is set to anything other than SizeMode.Normal, the ScaleFactor will be set back to the default value of 1.0. To get the current horizontal and vertical scale factors used to achieve current size mode (for example, fit the image into the control), use the CurrentXScaleFactor and CurrentYScaleFactor properties. Changing the scale factor when the SizeMode is set to anything other than SizeMode.Normal will cause SizeMode to be set back to SizeMode.Normal.

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
public void ImageViewer_ScaleFactor(ImageViewer viewer) 
{ 
   viewer.ScaleFactor = viewer.ScaleFactor * 0.9f; 
   string s = string.Format("HorizontalScaleFactor {0}, VerticalScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor); 
   MessageBox.Show(s); 
} 
Imports Leadtools.Windows.Controls 
 
Public Sub ImageViewer_ScaleFactor(ByVal viewer As ImageViewer) 
   viewer.ScaleFactor = viewer.ScaleFactor * 0.9F 
   Dim s As String = String.Format("HorizontalScaleFactor {0}, VerticalScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor) 
   MessageBox.Show(s) 
End Sub 
using Leadtools.Help; 
using Leadtools.Windows.Controls; 
 
public void ImageViewer_ScaleFactor(ImageViewer viewer) 
{ 
   viewer.ScaleFactor = viewer.ScaleFactor * 0.9f; 
   string s = string.Format("HorizontalScaleFactor {0}, VerticalScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor); 
   MessageBox.Show(s); 
} 
Imports Leadtools 
Imports Leadtools.Windows.Controls 
 
Public Sub ImageViewer_ScaleFactor(ByVal viewer As ImageViewer) 
   viewer.ScaleFactor = viewer.ScaleFactor * 0.9F 
   Dim s As String = String.Format("HorizontalScaleFactor {0}, VerticalScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor) 
   MessageBox.Show(s) 
End Sub 

Requirements

Target Platforms

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