Dispose Method

Summary

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Syntax
C#
VB
C++
public void Dispose() 
Public Sub Dispose()  
public: 
void Dispose();  
Remarks

Use this method to close or release unmanaged resources such as files, streams, and handles held by an instance of the class that implements this interface. By convention, this method is used for all tasks associated with freeing resources held by an object, or preparing an object for reuse.

Example
C#
VB
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
public bool _result = false; 
public ConvertCtrlForm _form = new ConvertCtrlForm(); 
 
public void FilterEnumMeritExample() 
{ 
   FilterEnum filterEnum = new FilterEnum(); 
 
   try 
   { 
      // Get LEAD H264 Decoder/Decompressor Merit 
      int currentMerit = filterEnum.GetMerit(Constants.PreferredFilters.H264Decompressor); 
 
      // Increase the value by "one" 
      int newMerit = currentMerit + 1; 
 
      // Set the new merit value to LEAD H264 Decoder/Decompressor 
      filterEnum.SetMerit(Constants.PreferredFilters.H264Decompressor, newMerit); 
 
      // Get the merit value again 
      currentMerit = filterEnum.GetMerit(Constants.PreferredFilters.H264Decompressor); 
 
      // Check and see whether the value has been set correctly 
      _result = (currentMerit == newMerit) ? true : false; 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
Imports Leadtools 
Imports Leadtools.Multimedia 
Imports LeadtoolsMultimediaExamples.Fixtures 
 
Public _result As Boolean = False 
Public _form As ConvertCtrlForm = New ConvertCtrlForm() 
 
Public Sub FilterEnumMeritExample() 
   Try 
      ' Create an object instance of FilterEnum 
      Dim filterEnum As FilterEnum = New FilterEnum 
 
      ' Get LEAD H264 Decoder/Decompressor Merit 
      Dim currentMerit As Integer = filterEnum.GetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor) 
 
      ' Increase the value by "one" 
      Dim newMerit As Integer = currentMerit + 1 
 
      ' Set the new merit value to LEAD H264 Decoder/Decompressor 
      filterEnum.SetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor, newMerit) 
 
      ' Get the merit value again 
      currentMerit = filterEnum.GetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor) 
 
      ' Check and see if the value has been set correctly 
      If currentMerit = newMerit Then 
         _result = True 
      Else 
         _result = False 
      End If 
 
   Catch e1 As Exception 
      _result = False 
   End Try 
End Sub 
Requirements

Target Platforms

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

Leadtools.Multimedia Assembly