0

I have a source bitmap of 300x100. I want to make a circle of 300x300 from this bitmap BUT i want to keep the aspect ratio. so the idea is to resize the source bitmap to 900*300 and them crop the source bitmap to 300x300 FROM THE MIDDLE (so remove 300 px from the top and remove 300 px from the bottom) so that at the end i have a square of 300x300 on with i can extract the circle.

is their anyone who can explain me how to do that ?

zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

0

here is the Bitmap Class Bitmap

once you load the Bitmap use this to scale it upto 900X300

Bitmap  createScaledBitmap (Bitmap src, int dstWidth, int dstHeight, boolean filter) 

then use this method to make a cut out of it at 300 X 300

Bitmap  createBitmap (Bitmap source, int x, int y, int width, int height) 
JRowan
  • 6,824
  • 8
  • 40
  • 59