01-06-2010 09:05 AM
@Peter: Thats pretty cool, I wonder if it works "perfectly" or if it has some glitches. I also wonder how fast it would go. Something to try later.
I actually gave some thought to this and I thought of using a drawPath function but couldn't figure out how and then I remembered SVG. It would have a large amount of overhead but would probably have perfect rotation. Create a SVG document, create a temp. image and put the image path into the basic SVG image. Take the image and change the transformation matrix (they have a simple rotate function for SVGMatrix) and you can draw a rotated image. A lot of overhead put a possible solution if that other one doesn't work.
01-06-2010 10:20 AM
@zany & @rcmaniac25 - the link I provided was just for information, it was not a suggestion, I have never tested it. I think if it works it is likely to be pretty fast. Not sure about glitches. That transformation does my head in.
There are other posts on this forum where more traditional (i.e. pixel at a time) rotation is discussed. If I remember correctly I have contributed some sample code to at least one of these, because I had a requirement to do some rotation for a project.
I suspect SVG is good way to go, but I have no experience with it.
Having said all that, I hope the original poster has managed to scale the image into something that can be rotated. 90 degrees rotation is easy. There is definitely simple sample code to do that somewhere on the forum (again I seem to remember that I contributed to one of the Threads)
04-25-2010 01:07 PM
I needed something simple to do a 90 degree rotation and trimmed down what was already posted to the following which some may find useful.
public static Bitmap rotateBitmap(Bitmap a_bitmap)
int width = a_bitmap.getWidth();
int height = a_bitmap.getHeight();
int row = new int[width];
Bitmap bitmap90 = new Bitmap(height, width);
for (int i = 0; i < height; ++i)
a_bitmap.getARGB(row, 0, width, 0, i, width, 1);
bitmap90.setARGB(row, 0, 1, (height - i - 1), 0, 1, width);