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 Native scale mode for the image, and WPF scale mode for the annotations.
- Use ImGearRenderSettings.ImageScaleSettings Property to specify the scaling mode for image rendering.
- Use ImGearRenderSettings.AnnotationScaleSettings Property to specify the scaling mode for annotations rendering.
Native 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:
- In most cases, a smaller buffer size for image display. Supports displaying huge images.
- Availability of advanced display interpolation settings.
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:
- It is truly resolution independent. You can use the same display and rendering settings to display or print an image, without the need to know the actual resolution of the output device.
- For small and medium size images, zoom and scrolling work much faster than in ImageGear display mode.
![]() |
WPF Scale Mode has a limitation on the displayed image size. See the WPF RenderMedia section, below, for more details. |
WPF RenderMedia
The WPF engine has limitations on image display that depend on image size and the way the image is rendered. ImageGear provides two options for rendering images in WPF scale mode. Use ImGearWpfDisplayScaleSettings.RenderMedia Property to specify the rendering media:
- ImGearRenderMedia.BitmapImage. ImageGear renders the image as an Image element, and uses a BitmapImage object as its source. Due to a limitation in the Silverlight framework, ImageGear only renders the image in its original size if the rendered image size does not exceed 16 megabytes. Otherwise, ImageGear renders the image in a reduced size, such that the rendered image size stays just within the 16 megabyte size limit. Use this mode for image display, unless you need to view very large images in actual size. Use Native scale mode or ImGearRenderMedia.WriteableBitmap to render media if you need to display large images in actual size.
- ImGearRenderMedia.WriteableBitmap. ImageGear renders the image as an Image element, and uses a WriteableBitmap object as its source. In this mode, the size of the displayed image is only limited by the amount of memory available to the Silverlight application. However, the WPF engine uses a lower quality algorithm for displaying such images downscaled (zoomed out). Use this mode to display very large images in actual size or for high quality printing.