←Select platform

ScaleFactor Property

Summary

Scale factor used to display the magnified image.

Syntax
C#
Objective-C
C++/CLI
public virtual double ScaleFactor { get; set; } 
@property (nonatomic, assign) double scaleFactor; 
public:  
   virtual property double ScaleFactor 
   { 
      double get() 
      void set(double value) 
   } 

Property Value

The scale factor used to display the magnified image. Default value is 2 (2X zoom).

Example
C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
 
public ImageViewer _imageViewer; 
 
public void ImageViewerExample() 
{ 
   // Create the image viewer 
   _imageViewer = new ImageViewer(); 
   _imageViewer.Dock = DockStyle.Fill; 
   _imageViewer.BackColor = SystemColors.AppWorkspace; 
   this.Controls.Add(_imageViewer); 
   _imageViewer.BringToFront(); 
 
   // Add Pan/Zoom interactive mode 
   // Click and drag to pan, CTRL-Click and drag to zoom in and out 
   _imageViewer.DefaultInteractiveMode = new ImageViewerPanZoomInteractiveMode(); 
 
   // Get each ImageViewerInteractiveMode. This should only return PanZoom 
   foreach (var mode in _imageViewer.InteractiveModes) 
   { 
      Debug.WriteLine(mode); 
   } 
 
   var intertiaOptions = ControlInertiaScrollOptions.CreateDefault(); 
   intertiaOptions.IsEnabled = true; 
 
   // Load an image 
   using (var codecs = new RasterCodecs()) 
      _imageViewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp")); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.