• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

image resolution

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey
how do you check and then change the resolution of a BufferedImage?
Thanks,
Brendan
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Brendan Kennedy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAI has it's homepage under JAI home
There you can find JAI itself and some tutorials and demos.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic