private static void RenderContainer(ImageViewerRenderEventArgs e, AnnRenderingEngine renderingEngine, AnnContainer container, bool runMode) { // Attach to the current container and graphics var context = e.PaintEventArgs.Graphics; var clipRectangle = e.PaintEventArgs.ClipRectangle; // Render the annotations renderingEngine.Attach(container, (Graphics)context); try { // Convert the clip rectangle to annotation coordinates var annClipRect = LeadRectD.Create(clipRectangle.X, clipRectangle.Y, clipRectangle.Width, clipRectangle.Height); annClipRect = container.Mapper.RectToContainerCoordinates(annClipRect); renderingEngine.Render(annClipRect, runMode); } finally { renderingEngine.Detach(); } }
private static void RenderContainer(ImageViewerRenderEventArgs e, AnnRenderingEngine renderingEngine, AnnContainer container, bool runMode) { object surface = e.SurfaceContext; if (surface == null) { return; } // Attach to the current container and context renderingEngine.Attach(container, surface); try { // Render the annotations renderingEngine.Render(LeadRectD.Empty, runMode); } finally { renderingEngine.Detach(); } }