Putting some indicator around the image in image move/resize/rotate operations

Vikalp Patel picture Vikalp Patel · Feb 10, 2013 · Viewed 17.9k times · Source

I would like to Scale, Move, Resize Image. I would like to surround the image with Indicators which guide user what operation these indicators perform i.e. Moving, Rotating, Scaling.

enter image description here

I've tried

  • Scaling - but it only crops down. No chance to increase length and height of image.
  • Rotate - achieved but via inserting manual degrees. That's not a good option in here.
  • Moving - as I'm achieving drag on Api < 11. So little bit of difficult. Still no hope in here.

Is there any library which can do me simple image edit [Move, Scale, Rotate]?

Answer

Pragnani picture Pragnani · Feb 10, 2013

You can use Matrix transaformation to achieve rotating, scaling, and moving....I hope this will help you....

for rotating

Matrix matrix = new Matrix();
    matrix.postRotate(90);

for scaling

 matrix.postScale(scaleWidth, scaleHeight);

create new bitmap without changing the original one...like this

Bitmap bmp2 = Bitmap.createBitmap(bmp1, 0, 0, pow2, pow2, matrix, true);