문제

So I have a bitmap.. Now I want to create 5 smaller bitmaps from specific regions of the original bitmap.

Is it possible to do this with paths or rects?

for instance : newBitmap = OriginalBitmap.copyFromArea(Path data | rect)

도움이 되었습니까?

해결책

You can use the createBitmap static method form the Bitmap class.

For example, if you have a 20x25 image (originalBitmap) and want a 5x6 slice (newSlice) at the bottom right corner, then you can do the following:

Bitmap newSlice = Bitmap.createBitmap (originalBitmap, 15, 19, 5, 6);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top