• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cant capture screenshot in simple animation project

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have changed but screenshot is always blank, any idea?

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic