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
UpdateZoneArea Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : UpdateZoneArea Method



pageIndex
Page index. This index is zero-based.
zoneIndex
Zone index to be updated. This index is zero-based.
area
Specifies the new zone area to be updated.
pageIndex
Page index. This index is zero-based.
zoneIndex
Zone index to be updated. This index is zero-based.
area
Specifies the new zone area to be updated.
Updates the specified zone area.

Syntax

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

Parameters

pageIndex
Page index. This index is zero-based.
zoneIndex
Zone index to be updated. This index is zero-based.
area
Specifies the new zone area to be updated.

Example

Visual BasicCopy Code
Public Sub UpdateZoneAreaExample(ByVal graph As Graphics)
   ' 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
   'select a zone

   Dim pt As Point = New Point(100, 100)

   rasterDocument.SelectZoneByPoint(graph, 0, pt)
   If rasterDocument.SelectedZoneIndex <> -1 Then
      Dim zoneData As RasterDocumentZoneData = rasterDocument.GetSelectedZoneData(0)
      Dim rc As Rectangle = zoneData.Rectangle
      rc.Offset(10, 50)

      Try
         rasterDocument.UpdateZoneArea(0, rasterDocument.SelectedZoneIndex, rc)
         MessageBox.Show("The selected zone area is updated")
      Catch ex As Exception
         MessageBox.Show(ex.Message)
      End Try
   End If

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void UpdateZoneAreaExample(Graphics graph) 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(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 
   // select zone 
 
   Point pt = new Point(100, 100); 
 
   rasterDocument.SelectZoneByPoint(graph, 0, pt); 
   if (rasterDocument.SelectedZoneIndex != -1) 
   { 
      RasterDocumentZoneData zoneData = rasterDocument.GetSelectedZoneData(0); 
      Rectangle rc = zoneData.Rectangle; 
      rc.Offset(10, 50); 
 
      try 
      { 
         rasterDocument.UpdateZoneArea(0, rasterDocument.SelectedZoneIndex, rc); 
         MessageBox.Show("The selected zone area is updated"); 
      } 
      catch (Exception ex) 
      { 
         MessageBox.Show(ex.Message); 
      } 
   } 
 
   rasterDocument.Shutdown(); 
}

Remarks

Updates the specified zone area in the specified page. To update general zone information, call UpdateZone.
For more information, refer to Drawing Pages and 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.