rotating images on device space
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, March 11, 2002 12:40 AM

Hi all, I have been working about two day's on the following problem: Print some data in a table layout. The layout has 2 columns and a lot of rows and a third column display an image. The problem is the image to display correctly. It is up to the size of the image in order to decide if that image has to rotate and scale in order to fit to the third column. The following code shows what I've done for the image: BufferedImage image = ; calculateTransformationValues(image, destW, destH); AffineTransform transform = new AffineTransform(); transform.translate(x, header); transform.scale(scaleValue, scaleValue); transfo   More>>

Hi all,

I have been working about two day's on the following problem:

Print some data in a table layout. The layout has 2 columns and a lot of rows and a third column display an image. The problem is the image to display correctly. It is up to the size of the image in order to decide if that image has to rotate and scale in order to fit to the third column.

The following code shows what I've done for the image:

BufferedImage image = ;
calculateTransformationValues(image, destW, destH);

AffineTransform transform = new AffineTransform();
transform.translate(x, header);
transform.scale(scaleValue, scaleValue);
transform.rotate(rotateValue, image.getWidth() / 2, image.getHeight() / 2);
g2d.transform(transform);

g2d.drawImage(image, 0, 0, null);

If I use rotation shown above the adjustment of the image is every time a different if the image size a different is. So the bigger the image the bigger the distance is between the second column and the image. The same apply to the adjustment in the hight. The bigger the image is so more the image move's up.

Has anybody help for me ? It is very important to me.

Thanks in forward

Rico

   <<Less
About | Sitemap | Contact