当前位置: 技术问答>java相关
Java可以对图片进行处理么?如RiSize等
来源: 互联网 发布时间:2015-10-07
本文导语: 想用Java程序实现对Jpg或其他格式文件的Risize操作,有这样的工具包么?用应用程序实现很简单,但Java就无从下手了! | 用这个函数 /** * Creates a scaled version of this image. ...
想用Java程序实现对Jpg或其他格式文件的Risize操作,有这样的工具包么?用应用程序实现很简单,但Java就无从下手了!
|
用这个函数
/**
* 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.
* @param width the width to which to scale the image.
* @param height the height to which to scale the image.
* @param hints flags to indicate the type of algorithm to use
* for image resampling.
* @return a scaled version of the image.
* @see java.awt.Image#SCALE_DEFAULT
* @see java.awt.Image#SCALE_FAST
* @see java.awt.Image#SCALE_SMOOTH
* @see java.awt.Image#SCALE_REPLICATE
* @see java.awt.Image#SCALE_AREA_AVERAGING
* @since JDK1.1
*/
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.
* @param width the width to which to scale the image.
* @param height the height to which to scale the image.
* @param hints flags to indicate the type of algorithm to use
* for image resampling.
* @return a scaled version of the image.
* @see java.awt.Image#SCALE_DEFAULT
* @see java.awt.Image#SCALE_FAST
* @see java.awt.Image#SCALE_SMOOTH
* @see java.awt.Image#SCALE_REPLICATE
* @see java.awt.Image#SCALE_AREA_AVERAGING
* @since JDK1.1
*/
public Image getScaledInstance(int width, int height, int hints)