←Select platform

ImageViewerSizeMode Enumeration

Summary

Determines how the control displays the image and the automatic adjustments of the display rectangles.

Syntax

C#
VB
Java
Objective-C
WinRT C#
public enum ImageViewerSizeMode  
Public Enum ImageViewerSizeMode  
   Inherits System.Enum 
public enum ImageViewerSizeMode  
enum LTImageViewerSizeMode 
public enum ImageViewerSizeMode 
Leadtools.Controls.ImageViewerSizeMode = function() { }; 
Leadtools.Controls.ImageViewerSizeMode.prototype = { 
 
  None = 0, 
    ActualSize = 1, 
    Fit = 2, 
    FitAlways = 3, 
    FitWidth = 4, 
    FitHeight = 5, 
    Stretch = 6, 
     
 }; 

Members

ValueMemberDescription
0None

No special sizing

1ActualSize

Use the image actual size

2Fit

Fit the image into the viewing area while maintaining the aspect ratio. If the image size is smaller than the viewing area, no resizing is done.

3FitAlways

Always fit the image into the viewing area while maintaining the aspect ratio even if the image size is smaller than the viewing area (in which case, the image will be scaled up)

4FitWidth

Fit the image width to be the size of the width of the viewing area while maintaining the aspect ratio

5FitHeight

Fit the image height to be the size of the height of the viewing area while maintaining the aspect ratio

6Stretch

Fit the image to fill the viewing area. Aspect ratio might not be maintained

Remarks

By setting the ImageViewer.SizeMode property to one of the ImageViewerSizeMode enumeration values, the control will determine how to fit the image in the viewing area.

When using the None and ActualSize with the ImageViewer control, vertical or horizontal scrollbars may become visible and functional if the image size becomes greater than the viewing area (depending on the value of ImageViewer.ScrollMode). The image size is determined by the image physical pixel width and height and the values of the ImageViewer.UseDpi and ImageViewer.ScaleFactor properties. The ImageViewer.AspectRatioCorrection will also play a role in determining the image size of its value is other than 1. The viewing area size is determined from the current pixel size of the control client area.

When the using ImageViewer.SizeMode, the value of ImageViewer.ScaleFactor will not be reset back to 1 automatically. You can either set the value of ImageViewer.ScaleFactor to 1 if this is the required behavior or use the ImageViewer.Zoom method that will have the size mode and scale factor values to setup the current view to any desired values using one method.

Example

For an example, see ImageViewer.Zoom.

Requirements

Target Platforms

See Also

Reference

Leadtools.Controls Namespace

Help Version 19.0.2017.10.28
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly (WinRT / WPF / iOS / OS X / Android)