Gets information about the zone at the specified index in the zone list of the specified page.
Syntax
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 Basic | Copy Code |
---|
Public Sub GetZoneExample()
RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")
Dim rasterDocument As RasterDocumentEngine
rasterDocument = RasterDocumentEngine.Instance
rasterDocument.Startup()
Try
Dim _zoneData As RasterDocumentZoneData = rasterDocument.GetZone(0, 0)
MessageBox.Show("The engine retrieved the specified zone information successfully")
Dim zoneArea As String
zoneArea = String.Format("Zone Area:{0}Left={1}{0}Top={2}{0}Right={3}{0}Bottom={4}", Chr(13), _zoneData.Area.Left, _zoneData.Area.Top, _zoneData.Area.Right, _zoneData.Area.Bottom)
MessageBox.Show(zoneArea)
_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"); String zoneArea = String.Format("Zone Area:\nLeft={0}\nTop={1}\nRight={2}\nBottom={3}", _zoneData.Area.Left, _zoneData.Area.Top, _zoneData.Area.Right, _zoneData.Area.Bottom); MessageBox.Show(zoneArea); _zoneData.FillMethod = RasterDocumentFillMethod.OcrA; _zoneData.Type = RasterDocumentZoneType.Graphic; rasterDocument.UpdateZone(0, 0, _zoneData); } catch (Exception ex) { MessageBox.Show (ex.Message); } rasterDocument.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also