falsetto
falsetto

Reputation: 789

Extract top part of bitmap in android

Is there a simple way to extract top part of bitmap like on the attached image and get only bottom part of bitmap?

Upvotes: 1

Views: 1366

Answers (1)

Faruk Yazici
Faruk Yazici

Reputation: 2404

It is quite easy actually. You have to use the method;

Bitmap dest=Bitmap.createBitmap(Bitmap source, int x, int y, int width, int height);

Here x and y are coordinates of starting points. In your case you want to set x to 0, y to something, width to the real width and height to a shorter one. Beware that the width and height you enter cannot be larger than the original bitmap's dimensions.

Upvotes: 2

Related Questions