public void BurnToRectWithDpi(LeadRectD destinationRect,double sourceDpiX,double sourceDpiY,double targetDpiX,double targetDpiY)
Public Sub BurnToRectWithDpi( _ByVal destinationRect As LeadRectD, _ByVal sourceDpiX As Double, _ByVal sourceDpiY As Double, _ByVal targetDpiX As Double, _ByVal targetDpiY As Double _)
-(void) burnToRectWithDpi:(LeadRectD) destinationRectsourceDpiX:(double)sourceDpiXsourceDpiY:(double)sourceDpiYtargetDpiX:(double)targetDpiXtargetDpiY:(double)targetDpiY;
public void burnToRectWithDpi(LeadRectD destinationRect,double sourceDpiX,double sourceDpiY,double targetDpiX,double targetDpiY)
public:void BurnToRectWithDpi(LeadRectD^ destinationRect,double sourceDpiX,double sourceDpiY,double targetDpiX,double targetDpiY)
destinationRect
The destination rectangle in container coordinates.
sourceDpiX
Horizontal source (image) DPI.
sourceDpiY
Vertical source (image) DPI.
targetDpiX
Horizontal target (screen) DPI.
targetDpiY
Vertical target (screen) DPI.
All visible objects in this container will be drawn into the current context.
This method uses the resolution (DPI) values specified and not the values stored in the container. Use this method when burning the container objects into any context.
To burn a container into the context of the image being automated, use Burn.
This example will create a container, add a couple of objects and then burn it into the viewer
using Leadtools.Annotations.Automation;using Leadtools.Annotations.Engine;using Leadtools.Annotations.Rendering;using Leadtools.Codecs;using Leadtools.Annotations.WinForms;public void AnnRenderingEngine_BurnToRectWithDpi(/*RasterImage image*/){// _viewer is ImageViewer _automation is working on// Get the containerAnnContainer container = _automation.Container;RasterImage image = _viewer.Image;double inch = 720.0;// Add a red line object, from 1in 1in to 2in 2inAnnPolylineObject lineObj = new AnnPolylineObject();lineObj.Points.Add(LeadPointD.Create(1 * inch, 1 * inch));lineObj.Points.Add(LeadPointD.Create(2 * inch, 2 * inch));lineObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(1));container.Children.Add(lineObj);// Add a blue on yellow rectangle from 3in 3in to 4in 4inAnnRectangleObject rectObj = new AnnRectangleObject();rectObj.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);rectObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1));rectObj.Fill = AnnSolidColorBrush.Create("Yellow");container.Children.Add(rectObj);IAnnAutomationControl annAutomationControl = _automation.AutomationControl;RasterColor[] colors = image.GetPalette();IntPtr hDC = Leadtools.Drawing.RasterImagePainter.CreateLeadDC(image);if (hDC != null){using (Graphics g = Graphics.FromHdc(hDC)){// Create a new rendering engine for this container and contextAnnWinFormsRenderingEngine renderingEngine = new AnnWinFormsRenderingEngine(container, g);// Set the resolutiondouble dpiX = g.DpiX;double dpiY = g.DpiY;double xRes = annAutomationControl.AutomationDpiX;double yRes = annAutomationControl.AutomationDpiY;// Burn itrenderingEngine.BurnToRectWithDpi(LeadRectD.Empty, dpiX, dpiY, xRes, yRes);}Leadtools.Drawing.RasterImagePainter.DeleteLeadDC(hDC);}// Delete the objects we added_automation.SelectObjects(container.Children);_automation.DeleteSelectedObjects();// Invalidate to see the burned objects_automation.Invalidate(LeadRectD.Empty);}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
