Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cut the portion of bitmap [duplicate]

Possible Duplicate:
How to crop the parsed image in android?

I have selected a portion from the bitmap and i am copying the selected portion in the same bitmap.. Now i want to remove the selected portion after copying.. How to do it?? please help me out..

like image 996
saranya krishnan Avatar asked Mar 25 '11 12:03

saranya krishnan


Video Answer


1 Answers

Just in case someone is trying to solve same problem, there is a better solution: Bitmap.createBitmap(Bitmap, int x, int y, int width, int height). For example, if you need to crop 10 pixels from each side of a bitmap then use this:

Bitmap croppedBitmap = Bitmap.createBitmap(originalBitmap, 10, 10, originalBitmap.getWidth() - 20, originalBitmap.getHeight() - 20); 
like image 139
a.ch. Avatar answered Sep 21 '22 02:09

a.ch.