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
SelectZoneByPoint(Graphics,Int32,Point) Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class > SelectZoneByPoint Method : SelectZoneByPoint(Graphics,Int32,Point) Method



graphics
Graphics object specified the device that contains the drawing.
pageIndex
Specifies the index of the page that contains the zones. This index is zero-based.
pt
Specifies the X and Y coordinates that specify a point inside a zone.
graphics
Graphics object specified the device that contains the drawing.
pageIndex
Specifies the index of the page that contains the zones. This index is zero-based.
pt
Specifies the X and Y coordinates that specify a point inside a zone.
Draws a selection rectangle around the zone located at the specified point.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub SelectZoneByPoint( _
   ByVal graphics As Graphics, _
   ByVal pageIndex As Integer, _
   ByVal pt As Point _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim graphics As Graphics
Dim pageIndex As Integer
Dim pt As Point
 
instance.SelectZoneByPoint(graphics, pageIndex, pt)
C# 
public void SelectZoneByPoint( 
   Graphics graphics,
   int pageIndex,
   Point pt
)
C++/CLI 
public:
void SelectZoneByPoint( 
   Graphics graphics,
   int pageIndex,
   Point pt
) 

Parameters

graphics
Graphics object specified the device that contains the drawing.
pageIndex
Specifies the index of the page that contains the zones. This index is zero-based.
pt
Specifies the X and Y coordinates that specify a point inside a zone.

Example

Visual BasicCopy Code
Public Sub SelectZoneByPointExample(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

   Dim pt As Point = New Point(100, 100)
   rasterDocument.SelectZoneByPoint(graph, 0, pt)
   MessageBox.Show("The selected zone index = " & rasterDocument.SelectedZoneIndex)
   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void SelectZoneByPointExample(Graphics graph) 

   // 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 
 
   Point pt = new Point(100, 100); 
   rasterDocument.SelectZoneByPoint(graph, 0, pt); 
   MessageBox.Show("The selected zone index = " + rasterDocument.SelectedZoneIndex); 
   rasterDocument.Shutdown(); 
}

Remarks

Draws a selection rectangle around the zone that contains the specified point.
This method will update the SelectedZoneIndex property value if it finds a zone that contains the specified point. To draw a page, call RasterDocumentEngine.DrawPage(Graphics,Int32,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties).
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.