0

I am making a simple image processing app and can't seem to display the bitmap on imageView, i have added the block of code that takes the image and creates a bitmap, everything is syntactically correct and i can't seem to find any errors upon debugging but it doesn't seem to work...

I am a beginner though I have tried to use solutions from other similar questions to no avail...

  /*Overrides startActivity and creates a Bitmap that is displays on imageview [NOT WORKING]*/

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    File imgFile = new  File("/sdcard/Image_Filter_App/cam_image");
    ImageView myImage = findViewById(R.id.image_view);
    if(imgFile.exists()){

        BitmapFactory.Options bmOptions = new BitmapFactory.Options();

        Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath(), bmOptions);
        myBitmap = Bitmap.createScaledBitmap(myBitmap,myImage.getWidth(),myImage.getHeight(),true);
        myImage.setImageBitmap(myBitmap);

    }    

I want the image to be displayed as a bitmap so i can later add some filter methods...

Mitchell
  • 13
  • 2

0 Answers0