2

I have one png image.

original image

Then, I want to flip this triangle as on the next image.

enter image description here

Red region it is our original image which is reflected and turned. And then I want to rotate new region (red region) on different angles. How can i do it in android? Thanks in advance!

Vikram
  • 3,996
  • 8
  • 37
  • 58

1 Answers1

3

To rotate an image in android you should look here

Or here

To get a mirror image of your PNG, do this (taken from the link below, from Dalmas's answer)

Matrix matrix = new Matrix(); 
matrix.preScale(-1.0f, 1.0f); 
Bitmap mirroredBitmap = Bitmap.createBitmap(bmp, 0, 0, bmp.width(), bmp.height(),  matrix, false);

To rotate a vector look here

Community
  • 1
  • 1
jcw
  • 5,132
  • 7
  • 45
  • 54
  • Everything is good... but... I think I'll have a little problem with straightforwardness of lines... as You can see border between green and red region is not ideal line... because it is pixels png image... and when I rotate image i'll take line of transperent regions insead of border – user1800819 Nov 15 '12 at 21:13
  • maybe, i can use vector graphic in this case? but i don't know how do it correctly – user1800819 Nov 15 '12 at 21:14
  • Thanks :) Maybe, it will help me! – user1800819 Nov 15 '12 at 21:38