LEADTOOLS Support
Document
Document SDK Questions
How to convert rectangle region to rectangle annotation
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, June 11, 2008 5:36:27 AM(UTC)
Groups: Registered
Posts: 12
Hi
i am trying to do the same thing by getting all the pPoint of the region and passing them to the procedure AnnDefine.
To get the pPoint of the region perimeter i try to use the GetRgnContourPoints procedure.
So my question is how can i acces to individual pPoints returned by the GetRgnContourPoints procedure?
Thanks for your help and sorry for my so poor english
#2
Posted
:
Thursday, June 12, 2008 3:53:42 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Are you also using v15? What is your programming interface?
What type of region are you trying to acquire (rectangle,
polygon, etc.)?
#3
Posted
:
Thursday, June 12, 2008 4:00:43 AM(UTC)
Groups: Registered
Posts: 12
I uses V14 under delphi 2005
I am trying to acquire free hand region
#4
Posted
:
Sunday, June 15, 2008 1:28:24 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If you are using the VCL LEAD Main (or Annotations) control, you can get the region contour points like this:
// In the Var section:
pPoints: pPoint;
PtSize: Cardinal;
i : Integer;
// Code snippet
LEADAnn1.GetRgnContourPoints(pPoints, PtSize);
For i := 1 to PtSize do
Begin
//Point number i sax X/Y coordinates of pPoints.X and pPoints.Y
inc(pPoints); // move to the next point in the array of points
End;
However, it will not be easy to convert these points to an annotations object, because the points will not trace the contour from the outside. The will list all region contour points from top to bottom and from left to right (line by line, horizontally).
If you want to get the points as they are being drawn by the user, you can capture the movement using the MouseMove event and store the points.
LEADTOOLS Support
Document
Document SDK Questions
How to convert rectangle region to rectangle annotation
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.