←Select platform

Burn Method

Summary
Burns the annotation objects in Container to the destination context using the existing destination rectangle and resolution (DPI).
Syntax
C#
Objective-C
C++/CLI
Java
Python
public virtual void Burn() 
- (void)burn; 
public void burn() 
public:  
   virtual void Burn() 
def Burn(self): 
Remarks

This method will call Render with clipRect set to LeadRectD.Empty.

Burning is different from rendering where the object's thumbs and the selection object will not be drawn.

Example
C#
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Engine; 
using Leadtools.Annotations.Rendering; 
using Leadtools.Codecs; 
using Leadtools.Annotations; 
using Leadtools.WinForms; 
 
public void AnnRenderingEngine_BurnToRectWithDpi(/*RasterImage image*/) 
{ 
   // _viewer is ImageViewer _automation is working on 
 
   // Get the container 
   AnnContainer container = _automation.Container; 
   RasterImage image = _viewer.Image; 
 
   double inch = 720.0; 
 
   // Add a red line object, from 1in 1in to 2in 2in 
   AnnPolylineObject 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 4in 
   AnnRectangleObject 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 context 
         AnnWinFormsRenderingEngine renderingEngine = new AnnWinFormsRenderingEngine(container, g); 
 
         // Set the resolution 
         double dpiX = g.DpiX; 
         double dpiY = g.DpiY; 
         double xRes = annAutomationControl.AutomationDpiX; 
         double yRes = annAutomationControl.AutomationDpiY; 
 
         // Burn it 
         renderingEngine.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); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.7.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.