Code public static Bitmap getBitmapCircleCrop(Bitmap bitmap, int Width, int Height) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); paint.setAntiAlias(true); canvas.drawAR..
Android
1. Bitmap to Drawable Drawable drawable = getResources().getDrawable(R.drawable.my_image); // drawable to bitmap Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap(); drawable 이미지를 가져와 Drawable에 생성한뒤 bitmap으로 형변환 하여 넣어준다 2. Drawable to Bitmap // bitmap to drawable Drawable drawable = new BitmapDrawable(bitmap); bitmap에서 가져와 drawable에 넣어 생성해준다. 때에 때라 여러가지 방법으로 drawable 혹은 bitmap을 사용하게 되는데 이미지를 ..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FRf3hp%2FbtszF2ohMeu%2F8BBsTepfNOOSXmqzMts5v1%2Fimg.png)
1. Bitmap 안드로이드에서 지원하는 이미지 포맷이다. 안드로이드는 이미지파일이나 메모리를 통해 Bitmap 파일을 다룰 수 있다. Bitmap을 통하여 이미지를 자르거나 편집, 파일형 변환을 통해 적절하게 사용처에 맞게 사용할 수 있다. Code Bitmap BitmapFactory.decodeFile(String pathName, BitmapFactory.Options opts); Bitmap BitmapFactory.decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts) 기본적으로 Bitmap은 사용시 메모리를 많이 할당하므로 다음과 같이 이미지 파일 크기를 줄여 사용한다 public static int c..