0

I have this layout and try save the FrameLayout and all childs in the one Bitmap. The getDrawingCache not return the Bitmap. I try this and this and not work.

<FrameLayout
        android:id="@+id/flPhoto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/imageOne"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:contentDescription="@null"
            android:src="@drawable/image1"/>

        <ImageView
            android:id="@+id/imageTwo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@null"
            android:src="@drawable/image2"
            android:layout_gravity="bottom|right"
            android:layout_margin="15dp"/>

    </FrameLayout>

    imageOne.buildDrawingCache();
    imageTwo.buildDrawingCache();
    flPhoto.setDrawingCacheEnabled(true);
    flPhoto.buildDrawingCache();

    mergedPhoto = flPhoto.getDrawingCache();

    String pathSavedBitmapFile = MediaStore.Images.Media.insertImage(getContentResolver(), mergedPhoto, "", null);
    flPhoto.destroyDrawingCache();
Community
  • 1
  • 1
user6505882
  • 247
  • 3
  • 16

0 Answers0