ImageGear .NET v24.12 - Updated
Specifying Scale Settings
User Guide > How to Work with... > Common Operations > Viewing > Viewing with WPF > Display Images in WPF Environment > Specifying Scale Settings

The ImGearPresentationPageDisplay Class API allows you to specify scale settings for image and annotation drawing under WPF graphics environment. Scale settings specify the engine that is used for image scaling, and provide information that is specific for a particular scale engine.

Since the PageView Class calls ImGearPresentationPageDisplay Class drawing methods internally, it provides public properties that allow the user to specify scale settings for internal drawing operations. Use the ImageScaleSettings Property to set scale settings for the image. Use the AnnotationScaleSettings Property to set scale settings for the annotations.

Scaling Modes

ImageGear provides two approaches for image display scaling:

The application can use either of these approaches, depending on its requirements.

ImageGear allows using either scaling mode for both the image and the annotations. You can use same mode for both the image and the annotations, or different modes in any combination. By default, ImageGear uses the ImageGear scale mode for the image, and WPF scale mode for the annotations.

ImageGear Scale Mode

In this mode, ImageGear performs all geometric transformations. This is the same approach that ImageGear uses with GDI+. Result image dimensions are calculated according to desired display size, in device-independent units, and display device resolution, specified via ImGearNativeDisplayScaleSettings.Resolution Property. When using a DrawToCanvas Method or DrawToBitmapImage Method that does not accept an ImGearRenderSettings Class parameter, ImageGear assumes the device resolution to be 96 dpi (default display resolution in Windows).

Use this approach is you prefer ImageGear to do the scaling. The benefits are:

WPF Scale Mode

In this mode, ImageGear does not perform any scaling. It outputs the image in its original size, and uses WPF transforms to position and scale the image. Use this approach if you prefer WPF to handle scaling.

In WPF scale mode, ImageGear does not need to redraw the image for zooming, scrolling, or layout updating. It only updates the geometric transform of the image element. To let ImageGear know that only a layout update is necessary, set ImGearWpfDisplayScaleSettings.UpdateLayoutOnly Property to true.

The benefits of this approach are:

Use ImGearRenderSettings.ImageScaleSettings Property to specify the scaling mode for image rendering. 

See Also