You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating some old code to Uno 6.2 (SkiaRenderer) and, not being completely familiar with how the SkiaRenderer really manages the VisualTree, have stumbled across something that doesn't seem to be working - taking screen shots (or at least in Android).
I've used two approaches to capturing a screen shot:
write Background of App's RootView (global::Android.App.Application.Context.Window.DecorView.RootView.Background) to Canvas of Bitmap:
vardisplayMetrics=newDisplayMetrics();activity.WindowManager.DefaultDisplay.GetRealMetrics(displayMetrics);varbitmap=Bitmap.CreateBitmap(displayMetrics.WidthPixels,displayMetrics.HeightPixels,Bitmap.Config.Argb8888);if(Build.VERSION.SdkInt<BuildVersionCodes.O)thrownewException("PixelCopy requires API 26+");varwindow=activity.Window;varlocationInWindow=newint[2];window.DecorView.GetLocationInWindow(locationInWindow);vartcs=newTaskCompletionSource<PixelCopyResult>();varhandler=newFinishedListener(tcs);PixelCopy.Request(window,bitmap,handler,newHandler(Looper.MainLooper));awaittcs.Task;returnbitmap;
In both cases, I'm getting a blank Bitmap. Does SkiaRenderer break this approach? Is there a bit of source code in the repo that you can point me to that would help me understand how to hook into the SkiaRenderer to get a bitmap?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm migrating some old code to Uno 6.2 (SkiaRenderer) and, not being completely familiar with how the SkiaRenderer really manages the VisualTree, have stumbled across something that doesn't seem to be working - taking screen shots (or at least in Android).
I've used two approaches to capturing a screen shot:
where:
In both cases, I'm getting a blank Bitmap. Does SkiaRenderer break this approach? Is there a bit of source code in the repo that you can point me to that would help me understand how to hook into the SkiaRenderer to get a bitmap?
Thank you for considering this!
Beta Was this translation helpful? Give feedback.
All reactions