Tuesday, July 26, 2011

Android - Matrix

Android provides a very neat and nice way to perform image transformation. The class is Matrix.


For example, if you are at a ImageView, you could scale the underlying bitmap image by the following codes

public void scale(){
//define a new matrix
Matrix m = new Matrix();
//double the scale
m.postScale(2.0f, 2.0f);
//set matrix to image
setImageMatrix(m);
}

By doing the above, the bitmap image will be scaled on next draw

No comments:

Post a Comment

Windows 7 - STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000)

If you encounter STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000) blue screen of death. This is very like...