Gets a value indicating whether the RasterImage object has been disposed of.
public bool IsDisposed {get;}
Public ReadOnly Property IsDisposed As Boolean
public:
property bool IsDisposed {
bool get();
}
true if the RasterImage object has been disposed of; false, otherwise.
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.
This example will show the use of the IsDisposed property of a RasterImage object.
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 LeadtoolsExamples.Common;
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);
MessageBox.Show("IsDisposed = " + image.IsDisposed.ToString());
// Now dispose the image
image.Dispose();
// Re-check the IsDisposed property, should be true
Assert.IsTrue(image.IsDisposed);
MessageBox.Show("IsDisposed = " + image.IsDisposed.ToString());
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Controls
Imports Leadtools.Dicom
Imports Leadtools.Drawing
Imports Leadtools.Svg
Public Sub IsDisposedTest()
' Create a RasterImage objects
Dim image As New RasterImage(
RasterMemoryFlags.Conventional,
100,
100,
24,
RasterByteOrder.Bgr,
RasterViewPerspective.TopLeft,
Nothing,
IntPtr.Zero,
0)
' Check the IsDisposed property, should be false
Debug.Assert(Not image.IsDisposed)
MessageBox.Show("IsDisposed = " + image.IsDisposed.ToString())
' Now dispose the image
image.Dispose()
' Re-check the IsDisposed property, should be true
Debug.Assert(image.IsDisposed)
MessageBox.Show("IsDisposed = " + image.IsDisposed.ToString())
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Dicom;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Examples;
using Leadtools.Windows.Media;
public void IsDisposedTest()
{
// Create a RasterImage objects
RasterImage image = new RasterImage(
RasterMemoryFlags.Conventional,
100,
100,
24,
RasterByteOrder.Bgr,
RasterViewPerspective.TopLeft,
null,
null,
0);
// Check the IsDisposed property, should be false
Debug.Assert(!image.IsDisposed);
Debug.WriteLine("IsDisposed = " + image.IsDisposed.ToString());
// Now dispose the image
image.Dispose();
// Re-check the IsDisposed property, should be true
Debug.Assert(image.IsDisposed);
Debug.WriteLine("IsDisposed = " + image.IsDisposed.ToString());
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Dicom
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Windows.Media
Public Sub IsDisposedTest()
' Create a RasterImage objects
Dim image As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, 100, 100, 24, RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, Nothing, Nothing, 0)
' Check the IsDisposed property, should be false
Debug.Assert((Not image.IsDisposed))
Debug.WriteLine("IsDisposed = " & image.IsDisposed.ToString())
' Now dispose the image
image.Dispose()
' Re-check the IsDisposed property, should be true
Debug.Assert(image.IsDisposed)
Debug.WriteLine("IsDisposed = " & image.IsDisposed.ToString())
End Sub
Products |
Support |
Feedback: IsDisposed Property - Leadtools |
Introduction |
Help Version 19.0.2017.6.19
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.