Forums Register Login

image resolution

+Pie Number of slices to send: Send
hey
how do you check and then change the resolution of a BufferedImage?
Thanks,
Brendan
+Pie Number of slices to send: Send
I do not know, if this is possible. Probably not. If you want to change something with your image, then you should have a look on JAI Java Advanced Imaging. They can do a lot. It is a good API.
+Pie Number of slices to send: Send
Thanks for replying
I did sort of(there's still some kinks) come up with a method that uses bufered image though. I can check the width in pixels using the SampleModel, then check the widthheight of the bufferedimage(they don't give you units but I'm guessing this is in either cm or mm. So if I want an x resolution of 160 ppi(pixels per inch)I convert the width to inches, divide this number into my current resolution to get the x ppi. I then use an AffineTransform to make a buffered image 160/x times smaller and then an AffineTransformOp to make the image the desired size. This is done in conjunction with the same operatoin for the height.
My maths could be off as I only came up with that last night and I haven't really looked to deeply into it this morning. Also there's obviously going to be some sort of round off error due to haveing to convert form int to double and back...
Could you please give me some links to some JAI/JIMI tutorials?
Regards,
Brendan
+Pie Number of slices to send: Send
JAI has it's homepage under JAI home
There you can find JAI itself and some tutorials and demos.
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1115 times.
Similar Threads
Cannot Start RMI Server
ExamLab SCJP 5 by Devaka cooray
Looks smaller in Unix ?
mssql jars not being found in common/lib directory on tomcat 5.5 server
Spring security intercept-url question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:57:17.