개발도구/aOS - 안드로이드 개발
[안드로이드] bitmap 을 drawable 로 변환하는 방법 Drawable
Hay's App
2012. 2. 17. 18:09
- bitmap 을 drawable 로 변환
Drawable d =new BitmapDrawable(bitmap);
- drawable 을 bitmap 으로 변환
Drawable d = getApplicationContext().getResources().getDrawable(R.drawable.icon);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGV_8888);
Canvas canvas = new Canvas(bitmap);
d.setBounds(0, 0, width, height);
d.draw(canvas);
Drawable d =new BitmapDrawable(bitmap);
- drawable 을 bitmap 으로 변환
Drawable d = getApplicationContext().getResources().getDrawable(R.drawable.icon);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGV_8888);
Canvas canvas = new Canvas(bitmap);
d.setBounds(0, 0, width, height);
d.draw(canvas);