2011-03-31 39 views

Trả lời

9

Bạn cần biến đổi Bitmap.

// make a mutable Bitmap 
Bitmap immutableBitmap = BitmapFactory.decodeResource(getResources(), 
    R.drawable.ic_watch); 
Bitmap mutableBitmap = immutableBitmap.copy(Bitmap.Config.ARGB_8888, true); 

// you have two bitmaps in memory, so clean up the mess a bit 
immutableBitmap.recycle(); immutableBitmap=null; 

Drawable d = new BitmapDrawable(mutableBitmap); 

// mutate it 
d.setColorFilter(new LightingColorFilter(color, lightenColor)); 

imageView.setImageDrawable(d); 

Bạn cũng có thể thấy sự cố này cũng cắt lên trên here.

+0

Cảm ơn, tôi sẽ cố gắng! Nếu nó không hoạt động, tôi sẽ cho bạn biết. – fhucho

Các vấn đề liên quan