How to merge text and image save in gallery. How to write text on image using camera.
When put text on image can not save in image with text only save image how to solve this issue.
I have also fragment dialog for text get form the user in customize fragment.
<ImageView
android:id="@+id/imgCapture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/txvText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="84dp"
android:background="#66cecece"
android:gravity="center"
android:padding="8dp"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
Code :
public void onUserSelectValue(String string) {
if (string != null) {
txvText.setVisibility(View.VISIBLE);
txvText.setText(string);
} else
txvText.setVisibility(View.GONE);
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
imgCapture.setImageBitmap(imageBitmap);
}
}