Let suppose you have an image named bar.png in the folder drawable of your project with size 200 * 200 px. And you wanted to scale it to some size let suppose 400 * 400 px.
Bitmap bmp=BitmapFactory.decodeResource(getResources(), R.drawable.bar);
bmp = Bitmap.createScaledBitmap(bmp, 400,400, true);
Now your image is scaled to 400 * 400 px.
Rotating an Bitmap Image :
Bitmap bmp=BitmapFactory.decodeResource(getResources(), R.drawable.bar);Matrix mtx = new Matrix();
mtx.postRotate(180); // rotating 180 degrees clockwise
Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth() ,bmp.getHeight() , mtx, true); // creating the bitmap image with new angle.
Now , bmp has original image, rotatedBMP has image with 180 degrees rotated.
Ι all the tіmе uѕed tο study piеce of writing in news ρapers but noω as I
ReplyDeleteam a user of web therefore from nοω I am uѕіng net foг content,
thanks tο wеb.
Look intо my page: best cheap stairlift online
Informatіve aгtісlе, exaсtly what I wаntеd
ReplyDeleteto find.
My website: Hublifte günstig