开发者

Efficient way to draw into a java.awt.graphics object

开发者 https://www.devze.com 2023-03-25 22:13 出处:网络
I\'m trying to create an animation by dynamically generating frames at each step of the animation. Now as I need to run an algorithm to drawpixel by pixel the new frame and I\'m using a BufferedImage

I'm trying to create an animation by dynamically generating frames at each step of the animation. Now as I need to run an algorithm to draw pixel by pixel the new frame and I'm using a BufferedImage that I access through its raster data. However 90% of the time is spent inside java.awt.graphcis.drawImage() that I use to transfer the image i开发者_运维百科nto the content of a JFrame.

Is there a more efficient way to draw pixel by pixel inside a graphics object?


Try to use VolatileImage. Much faster than that is hard to do..

0

精彩评论

暂无评论...
验证码 换一张
取 消