This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, September 19, 2007 12:23:05 PM(UTC)
Groups: Registered
Posts: 9
Hi All,
I'm converting some annotations from LT annotation format to another imaging toolkit annotation format. I'm using LT .NET v14.5. For most of the annotations, I don't have any problems, but I ran across this one where the bounds are outside the dimensions of the image - (BoundingRectangle.X is negative, Width is greater than the image width). What does this mean?
If I use Math.Min and Math.Max to truncate the values so they are within the bounds of the image and then compare the image in the two systems, LT still has the redaction correct (of course, since it wasn't changed), but the other imaging system shows the redaction rotated 90 degrees.
How do I interpret the redaction bounding rectangle that is outside the bounds of the image? Also, and this is most likely related, why is the redaction rotated?
Thanks in advance,
Ed S.
#2
Posted
:
Thursday, September 20, 2007 6:23:01 AM(UTC)
Groups: Registered
Posts: 9
Ok, I used InvalidRectangle instead of BoundingRectangle, and it looks as if that is working correctly.
Can anyone tell me the difference between BoundingRectangle and InvalidRectangle and why BoundingRectangle can sometimes be negative?
Thanks,
--Ed S.
#3
Posted
:
Friday, September 21, 2007 6:34:15 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Hello,
BoundingRectangle is the logical rectangle for the AnnObject. It's the rectangle before any transformations are applied to it. You are allowed to change to it. The InvalidRectangle is physical bounding rectangle. It's a read-only property to get the location of the AnnObject after the transformations have been applied. The invalid rectangle is also used to calculate the invalid region that needs to be repainted in the container. You can find much more information in the .NET documentation. Search for BoundingRectangle and InvalidRectangle, and scroll down to the bottom and read the Remarks section. It will give you specifics of what's considered invalid or bounding.
BoundingRectangle can be negative if there are translations in the transformation matrix. So if the transfrom matrix says move the object 1000px to the right and 1000px down, then your X and Y can be -500, -500. When the transformation is applied they will be 500, 500. You can find more information about the transformation matrix here:
http://www.codeproject.c...atrix_transformation.asp
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.