Render the content of the viewer to an external context.
public virtual void RenderRedirect(
Public Overridable Sub RenderRedirect(
ByVal graphics As System.Drawing.Graphics,
ByVal options As ImageViewerRenderRedirectOptions,
ByVal clipRectangle As LeadRect
virtual void RenderRedirect(
Target device context to render the content of the viewer to.
Clipping rectangle to use.
This method can be used to render the content of the viewer to an external context. ImageViewerPanControl uses this method to show a smaller version of the viewer in a separate external control.
To take a "snapshot" of the viewer surface to perform such operations as screen capture or printing, use RenderRedirect passing it the target context (of the printer or a bitmap).
To perform live updates for operations such as pan window, subscribe to the RedirectRender event to get notified whenever the viewer content is changed. Then call RenderRedirect to render the content of the viewer into the target device.
During the render cycle, the value of IsRenderRedirected will be set to true if this particular rendering operation is targeting an external device other than the viewer itself. If you are performing custom rendering, you can check the value of this property to apply any modification needed.
This example will mirror the content of the viewer into an external control with live updates whenever the viewer content changes.
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