Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, September 10, 2007 1:12:07 AM(UTC)

marasma  
marasma

Groups: Registered
Posts: 51


Hi,
need to known, how is possible to get the side's lenght of an AnnProtractorObject, specially from centerpoint to secondpoint.
I see that I can read the lenght of the protractor on screen, but I can't found any properties of function that I can use to get it programmatically, how I can do that.
I'm using Leadtools15 with VB.NET.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, September 10, 2007 9:38:43 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


There isn't any property of the AnnProtractorObject (even the AnnLine object doesn't) that tells you the length of either of the lines.  You will have to calculate this from the points.  Just use the Pythagorean Theorem and then convert that value from whatever unit it's in (most likely pixels) to the unit you want (inches, cm, etc.).
 
#3 Posted : Monday, September 10, 2007 9:42:06 AM(UTC)

BoydP  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

AnnProtractorObject exposes its three points as AnnPoints through the properties CenterPoint, FirstPoint and SecondPoint.  You can get the x and y coordinates of them and use the basic distance formula to determine the length of each side.  The following code determines the length of the side from the CenterPoint to SecondPoint.

Dim pt1 as AnnPoint = annProtractorObj.CenterPoint
Dim pt2 as AnnPoint = annProtractorObj.SecondPoint

Dim distance As Double = Math.Sqrt(Math.Pow(pt1.X - pt2.X, 2) + Math.Pow(pt1.Y - pt2.Y, 2))
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.