有人请尝试向我解释原因
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?
在设置缓存之前,我是否必须实际绘制视图?
谢谢!
我有两个视图(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.I我正在开发一个应用程序,我需要以编程方式访问android中的视频的帧缓冲区/ dev/graphics/fb0.我已经研究了很多,并且能够找到一个资源来解释它是如何完成的通过shell命令https://www.youtube.com/watch?v=BUPPyR6VasI, 但我希望以编程方式实现相同的目标.任何人都知道如何实现它.我真的很感激任何想法..
谢谢