Performance of rendering a bitmap using an image transform matrix on an ImageView
Basically, I want to render an image (bitmap) on an ImageView, but change its image transform matrix quite rapidly.
I'm new to android development and I'm not sure if what I'm doing is the right thing or not. I'm currently doing this by:
myImageView.setImageResource(resource_id); // only once
myImageView.setImageMatrix(myMatrix); // many times
The problem is that the rendering takes a lot of time - about 12 to 63 milliseconds depending on the visible area after the transform.
Does this use hardware acceleration? Is there a way to make it faster? Do I have to 开发者_C百科move to OpenGL (which I know nothing about)? Where do I start if I do (OpenGL 1.0/2.0)?
Thanks!
Android supports Hardware Acceleration starting in Honeycomb which is for tablets only. It will carry over into Ice Cream Sandwich (not out yet). Before that you will always be running in a software renderer.
Google has provided a nice breakdown of some of the device specs from what is being using in the Android Market.
For the custom animation you might want to check out the View Animation framework that already exists. Careful there's a new much better Property Animation framework introduced in Honeycomb as well.
精彩评论