androidのbitmapメモ

  • ResourceからBitmap
    BitmapFactory.decodeResource(getResources(), R.drawable.icon)
  • ResourceからDrawable
    getResources().getDrawable(R.drawable.icon)
  • DrawableからBitmap
    ((BitmapDrawable) drawable).getBitmap()
  • BitmapからDrawable
    new BitmapDrawable(bitmap)

引用:http://d.hatena.ne.jp/hyoromo/20100612/1276305512

コメント

このブログの人気の投稿

Activity以外からstartActivityする

in app billing v3 でサンドボックステストするときの話

@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree