LEADTOOLS Windows Forms (Leadtools.WinForms assembly)

CenterZoomAtPointScaleFactor Property

Show in webframe
Example 





Gets or sets the scale factor used to zoom the image in the viewer around the center when CenterAtPoint is called.
Syntax
[DefaultValueAttribute()]
[DescriptionAttribute("The zoom factor used when calling CenterAtPoint or when the interactive mode was set to ZoomAt. A value of 1 = no scale. A value greater than 1 will zoom the image around the center point by that amount. A value less than 1 will zoom the image around the center point by that amount.")]
[CategoryAttribute("Behavior")]
public virtual double CenterZoomAtPointScaleFactor {get; set;}
'Declaration
 
<DefaultValueAttribute()>
<DescriptionAttribute("The zoom factor used when calling CenterAtPoint or when the interactive mode was set to ZoomAt. A value of 1 = no scale. A value greater than 1 will zoom the image around the center point by that amount. A value less than 1 will zoom the image around the center point by that amount.")>
<CategoryAttribute("Behavior")>
Public Overridable Property CenterZoomAtPointScaleFactor As Double
'Usage
 
Dim instance As RasterImageViewer
Dim value As Double
 
instance.CenterZoomAtPointScaleFactor = value
 
value = instance.CenterZoomAtPointScaleFactor

            

            
[DefaultValueAttribute()]
[DescriptionAttribute("The zoom factor used when calling CenterAtPoint or when the interactive mode was set to ZoomAt. A value of 1 = no scale. A value greater than 1 will zoom the image around the center point by that amount. A value less than 1 will zoom the image around the center point by that amount.")]
[CategoryAttribute("Behavior")]
public:
virtual property double CenterZoomAtPointScaleFactor {
   double get();
   void set (    double value);
}

Property Value

The scale factor used to display the magnified image. Must be a value greater than 0. Default value is 1 (no zoom).
Remarks

Use the value of CenterZoomAtPointScaleFactor to perform zooming of the image around the center point when calling CenterAtPoint:

Example
Copy Code  
Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Drawing

Private Shared Sub CenterAtWithZoomExample(ByVal viewer As RasterImageViewer)
   ' Make sure the viewer size mode is normal
   viewer.SizeMode = RasterPaintSizeMode.Normal
   ' Set interactive mode to CenterAt
   viewer.InteractiveMode = RasterViewerInteractiveMode.CenterAt

   ' Set the center at scale factor to 1, so zoom in twice with each click
   viewer.CenterZoomAtPointScaleFactor = 2.0

   AddHandler viewer.InteractiveModeEnded, AddressOf viewer_InteractiveModeEnded
End Sub

Private Shared Sub viewer_InteractiveModeEnded(ByVal sender As Object, ByVal e As EventArgs)
   ' Check if this is the Center At interactive mode
   Dim viewer = CType(sender, RasterImageViewer)
   If viewer.InteractiveMode = RasterViewerInteractiveMode.CenterAt Then
      If viewer.CenterZoomAtPointScaleFactor = 2.0 Then
         ' Switch the scale factor to 0.5, so next time we click, it will zoom out twice
         viewer.CenterZoomAtPointScaleFactor = 0.5
      Else
         ' Back to 2, so we zoom in
         viewer.CenterZoomAtPointScaleFactor = 2.0
      End If
   End If
End Sub
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Color;
using Leadtools.Drawing;

private static void CenterAtWithZoomExample(RasterImageViewer viewer)
{
   // Make sure the viewer size mode is normal
   viewer.SizeMode = RasterPaintSizeMode.Normal;
   // Set interactive mode to CenterAt
   viewer.InteractiveMode = RasterViewerInteractiveMode.CenterAt;

   // Set the center at scale factor to 1, so zoom in twice with each click
   viewer.CenterZoomAtPointScaleFactor = 2.0;

   viewer.InteractiveModeEnded += viewer_InteractiveModeEnded;
}
private static void viewer_InteractiveModeEnded(object sender, EventArgs e)
{
   // Check if this is the Center At interactive mode
   RasterImageViewer viewer = sender as RasterImageViewer;
   if (viewer.InteractiveMode == RasterViewerInteractiveMode.CenterAt)
   {
      if (viewer.CenterZoomAtPointScaleFactor == 2.0)
      {
         // Switch the scale factor to 0.5, so next time we click, it will zoom out twice
         viewer.CenterZoomAtPointScaleFactor = 0.5;
      }
      else
      {
         // Back to 2, so we zoom in
         viewer.CenterZoomAtPointScaleFactor = 2.0;
      }
   }
}
Requirements

Target Platforms

See Also

Reference

RasterImageViewer Class
RasterImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.