Results 1 to 4 of 4
- 03-21-2009, 09:07 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 29
- Rep Power
- 0
How to Scale an Image with the help of Affine Transformation?
hi,
i need to scale up/down an image(java image object).the image is created as :
img=ImageIO.read(f)
where 'img' is the java image object and 'f' is a image file from the hard disk.
is it possible to do it with the help of affine transformation?
i studied some examples but they are related with drawing an image in the frame with the help of simple functions such as fillrect() etc.but i need to deal with the real image file.
plz help
- 03-21-2009, 12:39 PM #2
Have you read through the methods of Image to see whether there's anything there related to scaling the image?
db
- 03-21-2009, 04:26 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 29
- Rep Power
- 0
i checked the following link for scaling directly related with Image Class:
java.sun.com/j2se/1.4.2/docs/api/java/awt/Image.html#getScaledInstance(int,%20int,%20int)
but the method is not very much clear.
i have no idea what the hints is.need suggestions.is it possible to apply any other methods?getScaledInstance
public Image getScaledInstance(int width,
int height,
int hints)
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. The new Image object may be loaded asynchronously even if the original source image has already been loaded completely. If either the width or height is a negative number then a value is substituted to maintain the aspect ratio of the original image dimensions.
Parameters:
width - the width to which to scale the image.
height - the height to which to scale the image.
hints - flags to indicate the type of algorithm to use for image resampling.
Returns:
a scaled version of the image.
Thanks for Your Reply
- 03-21-2009, 09:34 PM #4
Similar Threads
-
Transformation
By rosh72851 in forum New To JavaReplies: 1Last Post: 11-19-2008, 04:11 PM -
OpenGl transformation question newbie
By ankitmcgill in forum New To JavaReplies: 1Last Post: 11-16-2008, 03:46 AM -
How to use Scale in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-07-2008, 04:49 PM -
Transform Scale
By Java Tip in forum java.awtReplies: 0Last Post: 06-21-2008, 08:53 PM -
Scale 2 or more pictures using a JSlider
By Panchitopro in forum AWT / SwingReplies: 4Last Post: 05-20-2008, 04:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks