In an android app I return from the android camera a bitmap which is set to an ImageView something like:
bitmap = android.provider.MediaStore.Images.Media
.getBitmap(cr, selectedImage);
image.setImageBitmap(bitmap);
Further more I wanna put a TextView on this image and after that save it to a website.Someone as an answer to another question on this topic suggested to do this in my xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</FrameLayout>
Well the problem with this is that the textView won’t be there when I save the image and upload it to a website!!!!I assume that this is just for the phone’s screen.
Anyway, if someone could help me with this I would appreciate it.Thanks!!
Since you have access to the Bitmap, you can use the Canvas with that bitmap and draw stuf directly on it:
After that you can draw the text on to the bitmap with the various canvas methods.
e.g.
See the Canvas API for more information.