Android - resize resources

텍스트 가운데로
feedbackactivity에는 메뉴이름써주자


Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.mipmap.ic_memo);
int width=bitmap.getWidth();
int height=bitmap.getHeight();
int newWidth=50;
int newHeight=50;

float scaleWidth=((float) newWidth)/width;
float scaleHeight=((float) newHeight)/height;

Matrix matrix=new Matrix();
matrix.postScale(scaleWidth,scaleHeight);
Bitmap resizedBitmap=Bitmap.createBitmap(bitmap,0,0,width,height,matrix,true);

bmd=new BitmapDrawable(getContext().getResources(),resizedBitmap);

댓글

이 블로그의 인기 게시물

포트란?

안드로이드 스마트폰 연결