快速連結

2013年2月20日

在ImageView中一次顯示多張圖片的技巧

在ImageView中一次顯示兩張圖片的技巧,話說,我還沒成功過!(欸)
可是來源的討論串是有人成功囉!
來源:overlay two images in android to set an imageview

private DoubleImage(Bitmap bm1, Bitmap bm2){
  ImageView imgView = new ImageView(this);
  Drawable[] layers = new Drawable[2];
  layers[0] = new BitmapDrawable(getResources(),bm1);
  layers[1] = new BitmapDrawable(getResources(),bm2);
  LayerDrawable layerDrawable = new LayerDrawable(layers);
  imgView.setImageDrawable(layerDrawable);
}

沒有留言:

張貼留言

歡迎大家留言提問,我會答的都會盡力回答!
如果太久沒出現回應就是我又忘記回來看留言了TAT