public static Bitmap convertViewToBitmap(View view) {
view.destroyDrawingCache();
view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
view.setDrawingCacheEnabled(true);
return view.getDrawingCache(true);
}
相关文章
- 【一天一道LeetCode】#109. Convert Sorted List to Binary Search Tree
- Android GUI之View事件处理
- [React] Simplify and Convert a Traditional React Form to Formik
- MVC+EF 随笔小计——分部视图(Partial View)及Html.Partial和Html.Action差异
- 如何理解andriod中的View和framelayout两个概念
- convert nocdb to cdb using dbms_pdb
- What is the difference between database table and database view?
- SAP技术 - How to create a CDS redirect view for a given database table
- [翻译]观察变换View Transform (Direct3D 9)
- 在ASP.NET MVC中使用Knockout实践04,控制View Model的json格式内容