Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cant capture screenshot in simple animation project

 
Massimo Dallara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

i have try everything but cant capture screenshot in my simple app.
this is code :

SurfaceViewActivity.java:



This is MainActivity.java


And this is activity_main.xml


Many thanks for the help
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

but cant capture screenshot

Which means what? What exactly are you doing, and what exactly is the result? Tells us which lines of code are being executed, which ones are not being executed and how that differs from what you expected.
 
Massimo Dallara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy , thanks for reply ,the code run without error but i capture only a blank screenshot
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The part with the ByteArrayOutputStream and ByteArrayInputStream looks unnecessarily complicated. Why doesn't bmp.compress write directly into the FileOutputStream?

Also note that if InputStream.read returns 0, that does NOT mean that the end of the input has been reached. That's what -1 means.
 
Massimo Dallara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok you can simplify, but the problem lies in the fact that I try to capture the screen in a SurfaceView and I read on the internet that is a little more complicated than usual, and despite my best efforts I can not create the screenshot
 
Massimo Dallara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have changed but screenshot is always blank, any idea?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic