Draws a shape on the viewer.
public class ImageViewerRubberBandInteractiveMode : ImageViewerInteractiveMode
Public Class ImageViewerRubberBandInteractiveMode
public ref class ImageViewerRubberBandInteractiveMode : ImageViewerInteractiveMode
The ImageViewerRubberBandInteractiveMode works as follows:
When DragStarted is received, InteractiveEventArgs.IsHandled is set to true and Render is called to to draw the rubber band shape Shape, BorderPen, and BackgroundBrush are used to customize the appearance of the shape. The RubberBandStarted event is also fired. Note that if you can derive your own class and override Render to customize the rendering of the shape.
The ImageViewerRubberBandInteractiveMode interactive mode does not perform any action on the viewer (besides drawing, moving and then removing the shape). It is up to the user to implement any custom operation required, (for example, to select a region of interest on the image). ImageViewerZoomToInteractiveMode derives from ImageViewerRubberBandInteractiveMode and calls ZoomToRect event. Drawing a rubber-band on the viewer is usually followed by another user operation to perform the action. In most cases, the rubber band is to be restricted on the "work" area. The RestrictToWorkBounds can control this behavior.
For more information, refer to Image Viewer Interactive Modes.
This example will use ImageViewerRubberBandInteractiveMode to select a region of interest in the image. When the user finishes selecting the area, the example will draw a blue with yellow border rectangle on the image.
Start with the ImageViewer example, remove all the code inside the example function (search for the "// TODO: add example code here" comment) and insert the following code:
Medical Web Viewer .NET