Posts

Showing posts with the label AffineTransform

Rotate an image with java Buffered image class..

Image
Hi, today I'm going to show you another image enhancing technique with Java's Buffered image class. That is rotating an image. To rotate an image with Java we use classes called AffineTransform and AffineTransformOp. And let's see how to rotate an image. It is very easy as previous things. In this post I'm not going to describe basics like creating an buffered image, display a buffered image on a JLabel..  etc .. but to describe methods I wrote in my program. 1). public void rescale() {} 2). private void rorateImg() {} Let's consider one by one.. public void rescale() {         tx = new AffineTransform();         tx.rotate(angel,w / 2, h / 2);//(radian,arbit_X,arbit_Y)         op = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);         bufferedImage=op.filter(bufferedImage,null);//(sourse,destination)        }//end rescale() [caption id="attachment_179" align="aligncenter" width="300" caption="Before rotating the i...