Its not possible to use Scalr
with android because it uses java.awt.image.BufferedImage
, which isn't part of the Android SDK (neither is the rest of java.awt
).
Android uses android.graphics.Bitmap
, not BufferedImage. I've yet to find as good of a library for Android as Scalr, but the Bitmap class support scaling, rotations and other transformations pretty well, look at createBitmamp with the matrix parameter.
For example, the following code flips a bitmap, then saves it in another bitmap
Matrix mirrorMatrix = new Matrix();
mirrorMatrix.preScale(-.5f, .5f);
// Create a flipped sprite using the transform matrix and the original sprite
flippedBitmap = Bitmap.createBitmap(orgBitmap, 0, 0, orgBitmap.getWidth(), orgBitmap.getHeight(),mirrorMatrix, true);