0

I'm trying to create a java game that will perform image effects (blurring, deforming, etc. on a BufferedImage) in real-time in conjunction with a BufferStrategy. To do this, I'd like to be able to access the actual backimage (and perform effects on that), and not just the graphics object obtained from strategy.getDrawGraphics(). After searching online and through the awt source, I haven't been able to find where that image actually is, or how to access it. Does anybody know? Should I just use my own bufferedimage and draw to that, then blit it to the backimage Graphics?

Thanks!

1 Answers1

2

The actual storage is specified in the direct know subclasses, Component.BltBufferStrategy and Component.FlipBufferStrategy; it is hidden intentionally as an implementation detail. JPanel is double buffered by default. Simply update your BufferedImage and render it, as shown here, here or here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045