Reputation: 3548
I am drawing bitmaps on the canvas using bitmap factory(see P.S.). I also have an animation applyed to my bitmap. I use bitMapFactory.options with options.inScaled = false; options.inDither = true;
The problem is when I draw my bitmap which is 100x100 size on smaller devices it rescales it automatically to smaller which is ok. The problem is when I draw it to a 10" device it scales it to be bigger but the image quality is lost. This isn't actually a problem. The problem is that the animation gets very slow even if the 10" device has way better hardware specs than the smaller ones I used.
Is there a way so that I can improve the speed for when the device draws bitmaps rescaled to bigger than their original size?
P.S.(I use BitmapFactory.decodeResource(mContext.getResources(),R.drawable.example, options);before onDraw is called in the beggining and on canvas I use drawBitmap.)
Upvotes: 2
Views: 3446
Reputation: 21367
I am drawing bitmaps on the canvas using bitmap factory
That's very cruel. BitmapFactory does not draw anything. It just loads the bitmap. I hope you don't load the Bitmap everytime a draw is invoked (Think that's what you tried to clarify with the last sentence:), still kinda confusing).
It came out that the loaded bitmaps should have THE SAME format as the display has.
Without code one can't say more!
Upvotes: 2
Reputation: 467
may be this post can help you
http://www.reddit.com/r/androiddev/comments/l46jn/why_is_android_still_auto_scaling_my_bitmaps/
Upvotes: 1