'setBounds'에 해당되는 글 1건

  1. 2011.05.13 Android - Bitmap, Drawable convert
posted by Solver Full-stack Developer 2011.05.13 13:42

Bitmap -> Drawable

Bitmap bitmap = new Bitmap (...);

Drawable drawable = new BitmapDrawable(bitmap);


Drawable -> Bitmap

Bitmap bitmap = Bitmap.createBitmap(width, height, true);
Drawable iconDrawable =
packageManager.getActivityIcon(resolveInfo.activityInfo);
Canvas canvas = new Canvas(bitmap);

drawable.setBounds(0, 0, width, height);
drawable.draw(canvas);

신고