常用方法
常用方法
常用方法
Related in langs
常用方法
public static Bitmap ConvertViewToBitmap(Android.Views.View v) { v.SetLayerType(LayerType.Hardware, null); v.DrawingCacheEnabled = true; v.Measure(Android.Views.View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified), Android.Views.View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified)); v.Layout(0, 0, v.MeasuredWidth, v.MeasuredHeight); v.BuildDrawingCache(true); Bitmap b = Bitmap.CreateBitmap(v.GetDrawingCache(true)); v.DrawingCacheEnabled = false; // clear drawing cache return(b); }