01.private Bitmap combineImage(Bitmap first, Bitmap second, boolean isVerticalMode){02.Options option = new Options();03.option.inDither = true;04.option.inPurgeable = true;05. 06.Bitmap bitmap = null;07.if(isVerticalMode)08.bitmap = Bitmap.createScaledBitmap(first, first.getWidth(), first.getHeight()+second.getHeight(), true);09.else10.bitmap = Bitmap.createScaledBitmap(first, first.getWidth()+second.getWidth(), first.getHeight(), true);11. 12.Paint p = new Paint();13.p.setDither(true);14.p.setFlags(Paint.ANTI_ALIAS_FLAG);15. 16.Canvas c = new Canvas(bitmap);17.c.drawBitmap(first, 0, 0, p);18.if(isVerticalMode)19.c.drawBitmap(second, 0, first.getHeight(), p);20.else21.c.drawBitmap(second, first.getWidth(), 0, p);22. 23.first.recycle();24.second.recycle();25. 26.return bitmap;27.}
비트맵 2장을 이어붙이는 방법(소스)
isVerticalMode = true를 주면 세로로, false를주면 가로로 합친다. 리턴은 Bitmap
정말 유용한 정보였습니다 ㅎㅎ
답글삭제담아갈게요 ㅎㅎ
감사합니다 !
답글삭제