←Select platform

Dispose(bool) Method

Summary
Releases all the resources used by this RasterGraphics.
Syntax
C#
C++/CLI
Python
[HandleProcessCorruptedStateExceptionsAttribute()] 
protected virtual void Dispose( 
   bool disposing 
) 
protected: 
virtual void Dispose(  
   bool disposing 
)  
def Dispose(self,disposing): 

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
 
 
public void CreateGraphicsExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")); 
 
   LeadPoint point1 = new LeadPoint(image.Width / 8, image.Height / 8); 
   LeadPoint point2 = new LeadPoint(image.Width / 2, image.Height / 2); 
 
   // Convert the coordinates if necessary. 
   if (image.ViewPerspective != RasterViewPerspective.TopLeft) 
   { 
      point1 = image.PointToImage(RasterViewPerspective.TopLeft, point1); 
      point2 = image.PointToImage(RasterViewPerspective.TopLeft, point2); 
   } 
 
   // Create the Graphics object 
   using (RasterGraphics rg = RasterImagePainter.CreateGraphics(image)) 
   { 
      rg.Graphics.DrawEllipse(new Pen(Color.White), point1.X, point1.Y, point2.X - point1.X, point2.Y - point1.Y); 
   } 
 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Image1_CreateGraphics.bmp"), RasterImageFormat.Bmp, 0); 
 
   image.Dispose(); 
   codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

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