Darren,

FDnC Red wrote
> 1) Am I transforming this rectangle by the matrix correctly?

Well, you are not transforming the rectangle but merely the two corner
points on one diagonal (rectXPt, rectYPt) and (tempEndXPt, tempEndYPt).

In case you merely want to consider transformations like the one in your
message, i.e.

> 1.1342565 0 0 1.199793 0 0 cm

only transforming those two points suffices because this transformation
matrix only scales but neither rotates nor skews. Thus, you know the
transformed rectangle will have edges parallel to the x and y axis
respectively.

If you want to consider generic transformations which may rotate or skew,
though, you'll have to transform all four points (well, it actually suffices
to transform three because the image of the rectangle will still be some
parallelogram which allows you to calculate the fourth point using the other
three points).

> 2) Is there an easier way?

It depends on your definition of "easier". If you are well acquainted with
linear algebra, writing it using the iText Vector and Matrix classes might
look more intuitive. The calculations behind the scenes are the same,
though.

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/CTM-re-tp4660398p4660401.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to