'bitmap'에 해당되는 글 3건

  1. 2011.05.27 Android - Bitmap resize
  2. 2011.05.13 Android - Bitmap 리소스, sdcard 이미지 load
  3. 2011.05.13 Android - Bitmap, Drawable convert
posted by Solver Full-stack Developer 2011.05.27 09:39

Bitmap src = BitmapFactory.decodeResource(getResources(), id);
src= Bitmap.createScaledBitmap(src, src_width, src_height,true);
신고
posted by Solver Full-stack Developer 2011.05.13 13:46

리소스의 이미지 load

Bitmap bitMapImage = BitmapFactory.decodeResource(getResources(), R.drawable.bar_port);

sdcard의 이미지 load

Bitmap bitMapImage = BitmapFactory.decodeFile("/sdcard/img.jpg");
신고
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);

신고