Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ScaleFactor Property
See Also  Example
Leadtools.WinForms Namespace > RasterImageViewer Class : ScaleFactor Property



The zoom factor used to display the image.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DescriptionAttribute("Select one of the center mode available to the control (none, horizonal, vertical or both).")>
Public Overridable Property ScaleFactor As Double
Visual Basic (Usage)Copy Code
Dim instance As RasterImageViewer
Dim value As Double
 
instance.ScaleFactor = value
 
value = instance.ScaleFactor
C# 
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Select one of the center mode available to the control (none, horizonal, vertical or both).")]
public virtual double ScaleFactor {get; set;}
C++/CLI 
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Select one of the center mode available to the control (none, horizonal, vertical or both).")]
public:
virtual property double ScaleFactor {
   double get();
   void set (double value);
}

Return Value

The zoom factor used to display the image.

Example

This example zooms out on the image displayed in the viewer

Visual BasicCopy Code
Public Sub RasterImageViewer_ScaleFactor(ByVal viewer As RasterImageViewer)
    viewer.ScaleFactor = viewer.ScaleFactor * 0.9F
    Dim s As String = String.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor)
    MessageBox.Show(s)
End Sub
C#Copy Code
public void RasterImageViewer_ScaleFactor(RasterImageViewer viewer) 

   viewer.ScaleFactor = viewer.ScaleFactor * 0.9f; 
   string s = string.Format("CurrentXScaleFactor {0}, CurrentYScaleFactor {1}", viewer.CurrentXScaleFactor, viewer.CurrentYScaleFactor); 
   MessageBox.Show(s); 
}

Remarks

You can get and set this property when the SizeMode property is RasterPaintSizeMode.Normal.
This property is read only when the SizeMode property is set to any other value. When SizeMode is set to RasterPaintSizeMode.Stretch, the zoom factor is the smallest of the Width or Height zoom factors (the aspect ratio is not preserved).

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also