This class represents scrollable viewport web control.
Namespace:
Aurigma.GraphicsMill.WebControls
Assembly:
Aurigma.GraphicsMill.WebControls (in Aurigma.GraphicsMill.WebControls.dll)
Public Class BitmapViewer _ Inherits ImageControlBase
public class BitmapViewer : ImageControlBase
This class is intended to display the image represented by the Bitmap object through the web. It allows zooming and scrolling the displayed image. Also, you can add a rubberband rectangle (e.g. use it to select a portion of the image).
To set the image which should be displayed, use the Bitmap property. You can either assign here an instance of the Bitmap class or call loading/creating methods of this class directly.
You can display a low-resolution preview image while the high-resolution fragment of image is loaded. To do it, set true to the PreviewImageEnabled property. When preview image is generated, its width and height is divided by the value stored in the PreviewImageResizeRatio property. This image is downloaded to the browser entirely and stretched at the container. After that high-resolution portion of the image is downloaded to the client and displayed in the viewport. This way user can preview (with very poor quality though) the portion of the image, and he can scroll to the necessary position on the image before high resolution fragment is loaded
When you apply some server-side code related to the image displayed in this control, it is often useful to see the results of the callbacks. For example, it is necessary for debugging purposes since it is the only way to get server-side error messages. Set the DebugFrameVisible property to true for that, and reset it to false when it is no longer necessary.
You can add a rubberband control at this bitmap. To do it, drag the rubberband control (e.g. RectangleRubberband) to the form and set its ID to the Rubberband property.
This control allows you zooming the displayed image. It can be done either manually or automatically. To zoom the image manually, you should specify the zooming coefficient through the Zoom property. If it is larger than 1, image is zoomed in, if smaller than 1 - zoomed out. Zoom = 1 means actual size.
To zoom the image automatically you can use the ZoomMode property. If it has other value than None, the zoom factor is calculated automatically (and you cannot change it until you switch to the manual mode). Depending on the mode, it can zoom image to fit it at the control without scroll bars (BestFit), zoom it to eliminate the horizontal scroll bar (FitToWidth), etc.
Alternatively you can use some of zooming navigator classes. To do it, drag ZoomInNavigator, ZoomOutNavigator, or ZoomRectangleNavigator control at the web form, and put its ID to the Navigator property. Also you can use a PanNavigator to navigate the image by dragging the mouse.