I am not sure that this is the best way but what I have ended up doing
was compositing the image myself. By drawing all 8 images onto one
bitmap and applying that single bitmap to the ImageView I was able to
get my animation to perform as I wanted. Now when I want to update a
section of the composited image I have to make the change to the
constituent bitmap and apply that to my Image View.
final BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Config.ARGB_8888;
Bitmap bitmap = BitmapFactory.decodeResource( this.getResources(),
this.houseMatrix[0][0], opt );
final int width = bitmap.getWidth();
final int height = bitmap.getHeight();
final Bitmap result = Bitmap.createBitmap( width, height,
Config.ARGB_8888 );
final Paint paint = new Paint();
paint.setColorFilter( new
PorterDuffColorFilter( this.houseMatrix[0][1],
PorterDuff.Mode.MULTIPLY ) );
final Canvas canvas = new Canvas( result );
canvas.drawBitmap( bitmap, 0, 0, paint );
bitmap.recycle();
for ( int i = 1; i < 8; i++ ) {
paint.setColorFilter( new
PorterDuffColorFilter( this.houseMatrix[i][1],
PorterDuff.Mode.MULTIPLY ) );
bitmap = BitmapFactory.decodeResource( this.getResources(),
this.houseMatrix[i][0], opt );
canvas.drawBitmap( bitmap, 0, 0, paint );
bitmap.recycle();
}
this.house.setImageBitmap( result );
On Feb 21, 8:22 am, Aaron <[email protected]> wrote:
> I have a LayerDrawable that I am creating in code because I have to do
> some color filtering to individual components of the layered image. On
> top of the layered image I have 2 ImageViews on top of one another and
> one is set to invisible. When the visible ImageView is clicked it
> rotates to 90 and made invisible and the invisible ImageView is made
> visible and rotated from -90 to 0.
>
> My issue is when I added the LayerDrawable which is made up of 8 pngs
> to the Activity the animation didn't work as well as before. It got
> verychoppyor didn't appear to rotate at all.
>
> Does anyone have any ideas regarding this?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en