Gets or sets the scale factor used to zoom the image in the viewer around the center when CenterAtPoint is called.
public virtual double CenterZoomAtPointScaleFactor { get; set; }
public:
virtual property double CenterZoomAtPointScaleFactor
{
double get()
void set(double value)
}
The scale factor used to display the magnified image. Must be a value greater than 0. Default value is 1 (no zoom).
Use the value of CenterZoomAtPointScaleFactor to perform zooming of the image around the center point when calling CenterAtPoint:
If the value of CenterZoomAtPointScaleFactor is 1 (the default value), then no zooming is performed
If the value of CenterZoomAtPointScaleFactor is greater than 1, then this value is multiplied by the current viewer scale factor (ScaleFactor) to zoom the image in around the center point
If the value of ScaleFactor is less than 1, then this value is multiplied by the current viewer scale factor (ScaleFactor) to zoom the image out around the center point
This example will set the viewer interactive mode to "center", it will also alternate the scale factor used with each click between 2 and 0.5. When you run this example, the first click on the viewer will center the image around that point while zooming it in twice. When you click again, the viewer will center the image around that point while zommong it out twice. Subsequent clicks will repeat these operations.
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;
}
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document