Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
GetZone Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : GetZone Method




pageIndex
Specifies the index of the page for which to get the zone information. This is a zero-based index.
zoneIndex
Specifies the index of the zone for which to get the information. This is a zero-based index.
Gets information about the zone at the specified index in the zone list of the specified page.

Syntax

Visual Basic (Declaration) 
Public Function GetZone( _
   ByVal pageIndex As Integer, _
   ByVal zoneIndex As Integer _
) As RasterDocumentZoneData
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim pageIndex As Integer
Dim zoneIndex As Integer
Dim value As RasterDocumentZoneData
 
value = instance.GetZone(pageIndex, zoneIndex)
C# 
public RasterDocumentZoneData GetZone( 
   int pageIndex,
   int zoneIndex
)
Managed Extensions for C++ 
public: RasterDocumentZoneData* GetZone( 
   int pageIndex,
   int zoneIndex
) 
C++/CLI 
public:
RasterDocumentZoneData^ GetZone( 
   int pageIndex,
   int zoneIndex
) 

Parameters

pageIndex
Specifies the index of the page for which to get the zone information. This is a zero-based index.
zoneIndex
Specifies the index of the zone for which to get the information. This is a zero-based index.

Return Value

RasterDocumentZoneData class which contains zone information for the specified zone in the specified page.

Example

Visual BasicCopy Code
Public Sub GetZoneExample()
   ' 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
      Dim _zoneData As RasterDocumentZoneData = rasterDocument.GetZone(0, 0)
      MessageBox.Show("The engine retrieved the specified zone information successfully")

      _zoneData.FillMethod = RasterDocumentFillMethod.OcrA
      _zoneData.Type = RasterDocumentZoneType.Graphic

      rasterDocument.UpdateZone(0, 0, _zoneData)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void GetZoneExample() 

   // 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 
   // assume page is recognized, refer to Recognize example for more information 
 
   try 
   { 
      RasterDocumentZoneData _zoneData = rasterDocument.GetZone(0, 0); 
      MessageBox.Show("The engine retrieved the specified zone information successfully"); 
 
      _zoneData.FillMethod = RasterDocumentFillMethod.OcrA; 
      _zoneData.Type = RasterDocumentZoneType.Graphic; 
 
      rasterDocument.UpdateZone(0, 0, _zoneData); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show (ex.Message); 
   } 
 
   rasterDocument.Shutdown(); 
}

Remarks

Retrieves zone information for the specified zone index in the specified page. To remove a specific zone, call RemoveZone. To add a zone, call AddZone.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features