i m trying to do a matrix transformation to an image.my problem is that i
have the valu of my matrix from another program the origin of the image is
the left upper corner but as i know in pdf the origin of coordonne is the
lower left that's why i cant use PdfTemplate i use instead Graphics2D to
have the same coordonne system.
Unfortunatly the image have the same dimension and the same rotation but it
is not complete because i have already set the wight and height of the
Graphics2D and it is not updated after transformation.
how can i update the dimension of the graphics2D to see all the picture.
PdfContentByte contentPage = writer.getDirectContentUnder();
contentPage.saveState();
contentPage.concatCTM(1, 0, 0,1,0, pageSize.getHeight()/2);
Graphics2D gimg =
contentPage.createGraphics((float)(155.52),(float)(207.36));
Image img ;
img = Toolkit.getDefaultToolkit().createImage("img.jpg");
AffineTransform transformer = new
AffineTransform(a,b,c,d,120,0);
gimg.transform(transformer);
gimg.drawImage(img, 0, 0,Math.round(w),Math.round(h), null);
gimg.dispose();
contentPage.restoreState();
i have tryied to do this with template but the dimension is wrong and the
rotation is true.
t.setMatrix(fxScale, fyRote, fxRote, fyScale,0,0);//for rotation
img.scaleAbsoluteHeight(transformation(getData("height").toString(),
2)*d);for scale Height
img.scaleAbsoluteWidth(transformation(getData("width").toString(),
2)*a);for scale Width
my second question is that can i extract the a (scalex) and d (scaley)
without the rotation value.
thanks for help.
--
View this message in context:
http://itext-general.2136553.n4.nabble.com/extract-only-scale-from-affine-transformation-or-update-the-dimension-of-Graphics2D-tp3448132p3448132.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
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