1

Hello I have tried all the solutions on the Stack like checking for the overflow and changing the sample size multiple times. Is there any other way that I can get the picture on the app in Bitmap format.

protected void onPhotoTaken()
    {

        Log.i( "MakeMachine", "onPhotoTaken" );
        _taken = true;

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

        options.inSampleSize = 4;
        options.inJustDecodeBounds = false;
        Bitmap bitmap = BitmapFactory.decodeFile( _path,options);
        _image.setImageBitmap(bitmap);

        _field.setVisibility( View.GONE );

    }

Anyways any help would be appreciated. I would love to hear a workaround as well.

My layout.xml is :-

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_horizontal|center_vertical">

    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="6"
        android:gravity="center_horizontal|center_vertical">

        <TextView android:id="@+id/field"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="No Image"
            android:gravity="center_horizontal"/>

        <ImageView android:id="@+id/image"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>

    </RelativeLayout>

    <Button android:id="@+id/button"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Take Photo"
        android:layout_weight="1"/>
</LinearLayout>

I have also tried the online project https://github.com/priyankvex/Easy-Ocr-Scanner-Android but it doesn't work for me. I hope somebody can help. The answer on this stackoverflow question also presents the exact same solution that I perormed Android: Display Image from SD CARD but it just doesn't work for me

Community
  • 1
  • 1
Arnav Goel
  • 31
  • 2
  • 11

0 Answers0