Leadtools.Document Deprecated as of v16. Refer to: Leadtools.Forms.Ocr | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
RemoveZone Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : RemoveZone Method



pageIndex
Specifies the index of the page for which the zone(s) will be deleted. This is a zero-based index.
zoneIndex
Specifies the index of the zone(s) to be deleted. This is a zero-based index.
pageIndex
Specifies the index of the page for which the zone(s) will be deleted. This is a zero-based index.
zoneIndex
Specifies the index of the zone(s) to be deleted. This is a zero-based index.
Removes one or more zones from the zone list for the specified page.

Syntax

Visual Basic (Declaration) 
Public Sub RemoveZone( _
   ByVal pageIndex As Integer, _
   ByVal zoneIndex As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
Dim zoneIndex As Integer
 
instance.RemoveZone(pageIndex, zoneIndex)
C# 
public void RemoveZone( 
   int pageIndex,
   int zoneIndex
)
C++/CLI 
public:
void RemoveZone( 
   int pageIndex,
   int zoneIndex
) 

Parameters

pageIndex
Specifies the index of the page for which the zone(s) will be deleted. This is a zero-based index.
zoneIndex
Specifies the index of the zone(s) to be deleted. This is a zero-based index.

Example

Visual BasicCopy Code
Public Sub RemoveZoneExample()
   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   Dim rasterDocument As RasterDocumentEngine
   rasterDocument = RasterDocumentEngine.Instance
   rasterDocument.Startup()
   'assume page is added, refer to AddPage example for more information
   'assume zones are added, refer to AddZone example or FindZones for more information

   Try
      rasterDocument.RemoveZone(0, 0)
      MessageBox.Show("The specified zone is deleted from the specified page")
   Catch e1 As Exception
      MessageBox.Show("The engine couldn't delete the specified zone")
   End Try

   rasterDocument.Shutdown()
End Sub
C#Copy Code
// RasterDocumentEngine rasterDocument; 
 
public void RemoveZoneExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); 
 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   // assume page is added, refer to AddPage example for more information 
   // assume zones are added, refer to AddZone example or FindZones for more information 
 
   try 
   { 
      rasterDocument.RemoveZone(0, 0); 
      MessageBox.Show("The specified zone is deleted from the specified page"); 
   } 
   catch (Exception) 
   { 
      MessageBox.Show("The engine couldn't delete the specified zone"); 
   } 
   rasterDocument.Shutdown(); 
}

Remarks

The zoneIndex parameter specifies the zone that will be deleted. If you pass –1 for the zoneIndex parameter, then this method will remove all zones in the zone list for the specified page. The index of the first zone in the zone list is zero (0).
For more information, refer to Working with Zones.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

The Leadtools.Document namespace is deprecated and no longer supported as of LEADTOOLS v16. For v16 and later, please refer to: Leadtools.Forms.Ocr. This documentation is retained for v15 and earlier informational use only.