Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我有ImageView&;TextView内部的RelativeLayout。现在我要在位图(ImageView)上放置文本了吗?_Android_Bitmap - Fatal编程技术网

Android 我有ImageView&;TextView内部的RelativeLayout。现在我要在位图(ImageView)上放置文本了吗?

Android 我有ImageView&;TextView内部的RelativeLayout。现在我要在位图(ImageView)上放置文本了吗?,android,bitmap,Android,Bitmap,在此之后,我想用文本和存储为位图捕获所有编辑的属性 我该怎么做 通过这种方式,您可以创建任意视图的位图 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="

在此之后,我想用文本和存储为位图捕获所有编辑的属性

我该怎么做


通过这种方式,您可以创建任意视图的位图

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="500dp"
    android:layout_height="500dp"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true"
    android:src="@android:drawable/sym_def_app_icon" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView1"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="17dp"
    android:text="Enter Your Text Here" />

</RelativeLayout>
yourRelativeLayout.setDrawingCacheEnabled(true);
yourRelativeLayout.buildDrawingCache();
Bitmap bm = yourRelativeLayout.getDrawingCache();