Question

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.)

Was it helpful?

OTHER TIPS

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top