| Author |
Uniform Scaling
|
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
|
|
Anyone know a good tutorial on how to uniformly resize an image is java? Thanks, Luke
|
Luke
SCJP
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8259
|
|
|
I don't know what you mean by "uniformly" but java.awt.Image has a getScaledInstance(int width, int height, int hints) method.
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
|
|
|
What I mean is, if I know the desired width (or height) I can get an image that doesn't look all distorted when I resize.
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8259
|
|
From the Java API Documentation of the method I mentioned above:
Creates a scaled version of this image. A new Image object is returned which will render the image at the specified width and height by default. If either width or height is a negative number then a value is substituted to maintain the aspect ratio of the original image dimensions. If both width and height are negative, then the original image dimensions are used.
|
 |
Luke Shannon
Ranch Hand
Joined: Sep 30, 2004
Posts: 239
|
|
|
Perfect! Thanks.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Uniform Scaling
|
|
|