Hi,

I have a problem - I am writing an application that displays up to 12
images on screen, and moves them around, plus reads touch events. I am
using a sample code I found, and it works great. Now I need adding 3D
- meaning emulating the objects moving in the Z axis, too (in/out of
screen).

To do this, I need to resize the images as they move.

To test this, I changed the following line in my onDraw (Panel) code:

canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);

to:

Bitmap bmpScaled = Bitmap.createScaledBitmap(bitmap, 112, 112, false);
canvas.drawBitmap(bmpScaled, coords.getX(), coords.getY(), null);

Which works, BUT - movement on screen, plus response to touch events
becomes real Jiggly.

Checking the log I see that every call to createScaledBitmap causes
garbage collection of around 90mS, which causes the total app to
respond jiggly.

Tried preparing 20 sized bitmaps beforehand, but since that moves the
calls to those createScaledBitmap to the beginning of the app - it
takes forever to load...

Can you think of any workaround or other way to achieve the scaling
effect ?

TIA

Shimon

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to