Questions tagged [android-pixel-copy]

Android API that copies a portion or all of a Window, Surface, or SurfaceView to a bitmap.

PixelCopy APIs provide a mechanism to issue pixel copy requests to allow for copy operations from Surface to Bitmap (e.g. capture all or a portion of a Window, SurfaceView, or a Surface to a bitmap). If the source Window's layout contains any SurfaceViews, their content will have to be separately copied.

11 questions
2
votes
1 answer

Rendering to an offscreen view and saving a screenshot

There are a variety of questions about saving an offscreen view to a bitmap, and I've followed all to no avail, which is why I don't think this is a duplicate of either. Background My app offers two different views of the same data. Both of these…
copolii
  • 14,208
  • 10
  • 51
  • 80
1
vote
0 answers

Android PixelCopy. Is that possible to take screenshot of another app with PixelCopy?

PixelCopy require as first argument Window or Surface. I can get it for my app, but can't get window from service for another apps. I was even trying to get it with AccessibilityNodeInfo and AccessibilityWindowInfo - I can get all windows sizes on…
1
vote
0 answers

Using PixelCopy to take a screenshot

I'm working on an Android Code Labs challenge (the first one) , that requires you to take a screen shot of an activity and emailing it to someone. There's only one activity and it displays "Hello World". So I decided to use API class PixelCopy -…
1
vote
0 answers

How I can to take screenshot of html page with video in webview on api 24?

I need to take a screenshot on Android API 24. If I'm using something like the code below, I'm able to take the screenshot but a video on the html page is black square! float scale = webView.getScale(); int height = (int)…
0
votes
0 answers

Pixel Copy crash: window doesn't have a backing surface

I'm trying to get a screenshot of a window, basically a bitmap. I need to also get the screenshot from accelerated hardware devices. I have implemented the PixelCopy API as the following: PixelCopyUtils @RequiresApi(Build.VERSION_CODES.O) object…
MACROSystems
  • 415
  • 3
  • 10
0
votes
0 answers

PixelCopy returns outdated data on Android 10

I get screenshots on Android 10 using Pixelcopy. I faced with a situation that when switching fragments via supportFragmentManager.beginTransaction().replace, an outdated screenshot is regularly returned. In fact, a new screen has already appeared -…
Viktoriia
  • 1
  • 1
0
votes
1 answer

Black screen in Screenshot

When I take the screenshot. The part where there is camera preview goes black. private fun getScreenShot(view: View): Bitmap { val returnedBitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888) …
0
votes
2 answers

How can I get the corner coordinate points of view in android?

I have a LinearLayout in my layout as show in the below diagram with blue background. How can I get the corner coordinate positions?Or How can I set them to specific positions?.For example I want the top-left corner to be at (50,50),top-right corner…
Asif Ali Khan
  • 49
  • 1
  • 12
0
votes
1 answer

PixelCopy android implementation

I am new to android development so I think this may be a teething issue on my part, but I am currently trying to use the PixelCopy function in android studio. I have code as shown below, and it matches what the base class is expecting although it is…
M.Walker
  • 33
  • 8
0
votes
0 answers

PixelCopy on pre-Nougat devices

I would like to use the functionality of PixelCopy (Image to bitmap) on pre-Nougat devices but unfortunately it is not available. Is there some compat method available which does the same thing? I'm thinking that if it is not available, I will have…
hellowill89
  • 1,538
  • 2
  • 15
  • 26
0
votes
1 answer

Using PixelCopy to copy a scaled View within a DialogFragment

I have a DialogFragment that creates an AlertDialog with a custom view in onCreateDialog. The custom view includes a spinning progress bar and a prompt as well as a large view (larger than screen dimensions) that is fit inside the custom content via…
copolii
  • 14,208
  • 10
  • 51
  • 80