Drawable을 비트맵으로 어떻게 바꾸죠?
조회수 4395회
발생하는 문제 및 실행환경
제가 디바이스 배경화면을 Drawable로 쓰고싶은데 wallpaper 함수를 보니까 Bitmap으로 밖에 안되더라고요. 그래서 WallpaperManager를 못쓰는데 Drawable을 Bitmap으로 바꿀수있을까요?
1 답변
-
Bitmap icon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_resource);
이건 Drawable을 비트맵으로 바꾸는거구요.
String name = c.getString(str_url); URL url_value = new URL(name); ImageView profile = (ImageView)v.findViewById(R.id.vdo_icon); if (profile != null) { Bitmap mIcon1 = BitmapFactory.decodeStream(url_value.openConnection().getInputStream()); profile.setImageBitmap(mIcon1); }
이건 웹에서 이미지 다운받을때 비트맵으로 받는 법
댓글 입력