1

I am able to extract the path of the image but I dont know how to use canvas.drawPicture()

I am able to draw the picture using mipmap, but the size exceeds the size of the pdf page, once I try to set the size of the mutable mipmap something happens to the image and doesn't scale, for example the resolution is 2560 x 1600 once I set the width to 500, i would say alot of copies are display within the 500 it is not reduced.

I am using setDensity() which actually reduce the image but is there a way to include canvas.drawPicture and modify the dimensions from there or any efficient way?

Bitmap bitmap = BitmapFactory.decodeFile(path);
        //bitmap.setDensity(2000);

        Bitmap mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);//<--true makes copy mutable



        mutableBitmap.setDensity(2000);
        Toast.makeText(this, mutableBitmap.getWidth() + " " , Toast.LENGTH_LONG).show();



    canvas.drawBitmap(mutableBitmap,0,320,null);
   // Toast.makeText(this, centreX + " ", Toast.LENGTH_LONG).show();
maniest
  • 11
  • 1

0 Answers0