selfstarter

Android drawable image에서 bitmap으로 변환 본문

App/Android

Android drawable image에서 bitmap으로 변환

selfstarter 2020. 6. 15. 12:41

Android drawable image에서 bitmap으로 변환

drawable image -> bitmap

bitmap -> drawable image로 변환

 

Context context = getApplicationContext();
Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.girl, null);
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
Drawable drawable1 = new BitmapDrawable(context.getResources(), bitmap);

'App > Android' 카테고리의 다른 글

How to make Simple CustomDialog in Android  (0) 2020.06.27
constraintlayout weight  (0) 2020.06.20
Android Example with Fragment and ToolBar  (0) 2020.06.04
Android fragment 정리  (0) 2020.06.04
XML에 선언된 Fragment Java객체로 가져오기  (0) 2020.05.31
Comments