0

I would like to draw on a SurfaceView but not display it. It's used to generate images that eventually get fed into codec to produce a video. According to the documentation, SurfaceView appears to be something that is intended to be displayed. Is it possible to use it without actually displaying it?

Johann
  • 27,536
  • 39
  • 165
  • 279
  • Have you tried: changing the z-order of the View OR as you are trying to do media, render to a Texture and doing something like [Taking picture from camera without preview](https://stackoverflow.com/q/2386025/295004). Not sure if you've seen: [Android: Is it possible to create a SurfaceTexture without a SurfaceView?](https://stackoverflow.com/q/23378993/295004) and https://github.com/google/grafika – Morrison Chang Apr 15 '21 at 07:08
  • It depends of HOW you need to generate these images. A Bitmap/Canvas is not enough? – emandt Apr 15 '21 at 09:21

1 Answers1

0

There is a setVisibility Method, maybe you try using that.

setVisibility(int visibility) Set the visibility state of this view.

  • 1
    OP is probably asking for a way for using `SurfaceView` without adding to/using `Activity`, `setVisibility` method is probably irrelevant in here – snachmsm Apr 15 '21 at 06:44
  • @snachmsm That is correct. No activity. Just draw in memory. – Johann Apr 15 '21 at 06:45