ImageViewerZoom Property

Gets or sets the zoom factor of the displayed image.
Default value: 1.

See the online help for an animated image example.

Definition

Namespace: KGySoft.WinForms.Controls
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public float Zoom { get; set; }

Property Value

Single

Remarks

This property can be set only if the AutoZoom property is .

Setting this property to NaN is equivalent to setting it to 1. Also, this property never throws an exception if the value is not a valid zoom factor. Instead, it is automatically adjusted to a valid value.

The minimum zoom factor dynamically depends on the image size, so that the minimum zoomed image is at least 1 pixel in width and height.

The maximum zoom factor is also dynamically determined based on the image size and the screen size. For Metafile images, the maximum zoom allows reaching about 4 million pixels width and height. For Bitmap images, the default maximum zoom is the original image size x 10 (adjusted with DPI) but at least screen size x 2.

Examples

  Tip

See the Examples section of the ImageViewer class for an animated image example.

See Also