Java中图像的旋转

//创建一个缓冲图像区
BufferedImage bufimg =new BufferedImage(imgBuff.getWidth(this) ,imgBuff.getHeight(this),imgBuff.getType());

//构造变换矩阵,执行变换
AffineTransform transform = new AffineTransform ();
transform.rotate(angle,0,0);//angel是角度,弧度制,0,0是旋转的中心点
AffineTransformOp op = new AffineTransformOp(transform,null);
op.filter(imgBuff, bufimg);

//
imgShow = bufimg;

如上面所述,最好用双缓冲。。
 

Leave a Reply

Your email address will not be published.