0

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)

nsgulliver
  • 12,655
  • 23
  • 43
  • 64
renners
  • 45
  • 6

1 Answers1

1

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);
Shade
  • 9,936
  • 5
  • 60
  • 85