setDrawingCacheEnabled
全部标签 我编写了一个绘制折线图的代码。此图是使用AndroidPlot绘制的。如何将此图另存为.png图像?? 最佳答案 xyPlot.setDrawingCacheEnabled(true);intwidth=xyPlot.getWidth();intheight=xyPlot.getHeight();xyPlot.measure(width,height);Bitmapbmp=Bitmap.createBitmap(xyPlot.getDrawingCache());xyPlot.setDrawingCacheEnabled(false
我使用这些行来截取我的Activity:Viewtoppest=((ViewGroup)ctx.getWindow().getDecorView().findViewById(android.R.id.content)).getChildAt(0);toppest.setDrawingCacheEnabled(true);Bitmapbmap=toppest.getDrawingCache();Utils.saveBitmapOnSdcard(bmap);toppest.setDrawingCacheEnabled(false);无论如何,此屏幕截图不包含操作栏。如何使用actionB
我想知道截取当前屏幕(按下按钮后)并将其保存在图库中的代码是什么,因为我没有带SD卡的设备。所以我会保存在默认图库中。谢谢 最佳答案 Bitmapbitmap;Viewv1=findViewById(R.id.rlid);//geturrootviewidv1.setDrawingCacheEnabled(true);bitmap=Bitmap.createBitmap(v1.getDrawingCache());v1.setDrawingCacheEnabled(false);这应该可以解决问题。用于保存ByteArrayOutp
在我的list中,我指定(针对整个应用程序)样式:android:theme="@android:style/Theme.NoTitleBar"然后在我的应用程序中,我想使用绘图缓存创建应用程序的屏幕截图:ViewactivityView=getActivity().getWindow().getDecorView().findViewById(android.R.id.content);activityView.setDrawingCacheEnabled(true);BitmapcurrentScreen=Bitmap.createBitmap(activityView.getDr