Gets or sets the zoom factor used to display the image. This is a dependency property.
Supported in Silverlight, Windows Phone 7
Syntax
Visual Basic (Declaration) | |
---|
Public Property ScaleFactor As Double |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As ImageViewer
Dim value As Double
instance.ScaleFactor = value
value = instance.ScaleFactor |
C# | |
---|
public double ScaleFactor {get; set;} |
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
Example
Visual Basic | Copy Code |
---|
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 |
C# | Copy Code |
---|
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);
} |
SilverlightCSharp | Copy Code |
---|
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);
} |
SilverlightVB | Copy Code |
---|
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 |
XAML | Copy Code |
---|
<Window x:Class="WPFSamples.ImageViewer" Height="600" Width="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls">
<DockPanel>
<Leadtools_Windows_Controls:ImageViewer Name="theViewer" Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg" DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center" ScaleFactor=".9" />
</DockPanel>
<Window.Title>
InteractiveZoomTo Sample : "ScaleFactor =0.9"
</Window.Title>
</Window> |
Remarks
Requirements
Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also