如何转换视图的转换为位图?位图、视图、转换为

由网友(爱情这东西姐不懂)分享简介:我有两个观点的(TextView的,ImageView的)中的FrameLayout,我要保存的图像与文字。这个秘密,以位图。XML是:<的FrameLayout机器人:ID =@ + ID /的FrameLayout机器人:layout_marginTop =30dip机器人:layout_height =F...

我有两个观点的(TextView的,ImageView的)中的FrameLayout,我要保存的图像与文字。这个秘密,以位图。 XML是:

 <的FrameLayout
     机器人:ID =@ + ID /的FrameLayout
     机器人:layout_marginTop =30dip
     机器人:layout_height =FILL_PARENT
     机器人:layout_width =FILL_PARENT>

     < ImageView的
          机器人:ID =@ + ID / ImageView01
          机器人:layout_height =WRAP_CONTENT
          机器人:layout_width =WRAP_CONTENT/>

    < TextView的机器人:ID =@ + ID / text_view
          机器人:layout_marginTop =30dip
          机器人:layout_width =WRAP_CONTENT
          机器人:MAXLINES =20
          机器人:滚动条=垂直
          机器人:layout_height =WRAP_CONTENT/>

< /的FrameLayout>
 

解决方案

如何转换成浏览位图

 的FrameLayout视图=(的FrameLayout)findViewById(R.id.framelayout);

view.setDrawingCacheEnabled(真正的);

view.buildDrawingCache();

位图BM = view.getDrawingCache();
 

位图如何转为矢量图

I have Two view's (Textview, imageView) in the framelayout, i want to save the image with text. for this covert view to bitmap. xml is:

<FrameLayout 
     android:id="@+id/framelayout"
     android:layout_marginTop="30dip"
     android:layout_height="fill_parent" 
     android:layout_width="fill_parent">

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

    <TextView android:id="@+id/text_view"
          android:layout_marginTop="30dip"
          android:layout_width="wrap_content" 
          android:maxLines="20"
          android:scrollbars="vertical"
          android:layout_height="wrap_content"/>

</FrameLayout>

解决方案

How to convert View into Bitmap

FrameLayout view = (FrameLayout)findViewById(R.id.framelayout);

view.setDrawingCacheEnabled(true);

view.buildDrawingCache();

Bitmap bm = view.getDrawingCache();

阅读全文

相关推荐

最新文章