←Select platform

IsDisposed Property

Summary
Gets a value indicating whether the RasterImage object has been disposed of.
Syntax
C#
C++/CLI
Java
Python
public bool IsDisposed { get; } 
public boolean isDisposed(); 
public: 
property bool IsDisposed { 
   bool get(); 
} 
IsDisposed # get  (RasterImage) 

Property Value

true if the RasterImage object has been disposed of; false, otherwise.

Remarks

When this property returns true, the RasterImage object is disposed of and can no longer be referenced as a valid object. Even though the instance of an object is disposed of, it is still maintained in memory until it is removed from memory through garbage collection. When an object is disposed, you should not check any other properties or call any other methods in the control or an NullReferenceException error will occur.

If it is required to track when a RasterImage object is disposed, use the Disposed event.

The RasterImage class implements the IDisposable interface, it is recommended that you follow the standard .NET dispose pattern when using the RasterImage class. For more information, refer to the IDisposable interface documentation in MSDN.

Example

This example will show the use of the IsDisposed property of a RasterImage object.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Core; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Dicom; 
using Leadtools.Drawing; 
using Leadtools.Controls; 
using Leadtools.Svg; 
 
 
public void IsDisposedTest() 
{ 
   // Create a RasterImage objects 
   RasterImage image = new RasterImage( 
      RasterMemoryFlags.Conventional, 
      100, 
      100, 
      24, 
      RasterByteOrder.Bgr, 
      RasterViewPerspective.TopLeft, 
      null, 
      IntPtr.Zero, 
      0); 
 
   // Check the IsDisposed property, should be false 
   Assert.IsTrue(!image.IsDisposed); 
   Console.WriteLine("IsDisposed = " + image.IsDisposed.ToString()); 
 
   // Now dispose the image 
   image.Dispose(); 
 
   // Re-check the IsDisposed property, should be true 
   Assert.IsTrue(image.IsDisposed); 
   Console.WriteLine("IsDisposed = " + image.IsDisposed.ToString()); 
} 
Requirements

Target Platforms

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

Leadtools Assembly

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