相关疑难解决方法(0)

Android View.getDrawingCache返回null,仅返回null

有人请尝试向我解释原因

public void addView(View child) {
  child.setDrawingCacheEnabled(true);
  child.setWillNotCacheDrawing(false);
  child.setWillNotDraw(false);
  child.buildDrawingCache();
  if(child.getDrawingCache() == null) { //TODO Make this work!
    Log.w("View", "View child's drawing cache is null");
  }
  setImageBitmap(child.getDrawingCache()); //TODO MAKE THIS WORK!!!
}
Run Code Online (Sandbox Code Playgroud)

ALWAYS记录绘图缓存为空,并将位图设置为null?

在设置缓存之前,我是否必须实际绘制视图?

谢谢!

android android-view

94
推荐指数
3
解决办法
7万
查看次数

如何将视图转换为位图?

我有两个视图(Textview&ImageView)FrameLayout,我想用文本保存图像.为此,我将View转换为位图.

我的xml是:

<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>
Run Code Online (Sandbox Code Playgroud)

android bitmap

34
推荐指数
2
解决办法
4万
查看次数

以编程方式读取android中的帧缓冲区/ dev/graphics/fb0

我正在研究android.I我正在开发一个应用程序,我需要以编程方式访问android中的视频的帧缓冲区/ dev/graphics/fb0.我已经研究了很多,并且能够找到一个资源来解释它是如何完成的通过shell命令https://www.youtube.com/watch?v=BUPPyR6VasI, 但我希望以编程方式实现相同的目标.任何人都知道如何实现它.我真的很感激任何想法..

谢谢

android buffer live frame video-streaming

5
推荐指数
1
解决办法
4368
查看次数

标签 统计

android ×3

android-view ×1

bitmap ×1

buffer ×1

frame ×1

live ×1

video-streaming ×1