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!
The actual storage is specified in the direct know subclasses,
Component.BltBufferStrategy
andComponent.FlipBufferStrategy
; it is hidden intentionally as an implementation detail.JPanel
is double buffered by default. Simply update yourBufferedImage
and render it, as shown here, here or here.