A
Abs
Hi people,
I'm using active rendering over a JPanel implementing Runnable and I
have some doubts I want share with you. Which of the following codes is
better (performace, etc...):
1st one:
-----------
BufferedImage im=loadImage(file);
Graphics2D g = (Graphics2D) getGraphics();
while (threadSuspended) {
g.drawImage(im, 0, 0, this);
}
g.dispose();
2nd one:
------------
BufferedImage im=loadImage(file);
while (threadSuspended) {
Graphics2D g = (Graphics2D) getGraphics();
g.drawImage(im, 0, 0, this);
g.dispose();
}
Do I have to flush the BufferedImage too ? when ?
Thanks in advance
I'm using active rendering over a JPanel implementing Runnable and I
have some doubts I want share with you. Which of the following codes is
better (performace, etc...):
1st one:
-----------
BufferedImage im=loadImage(file);
Graphics2D g = (Graphics2D) getGraphics();
while (threadSuspended) {
g.drawImage(im, 0, 0, this);
}
g.dispose();
2nd one:
------------
BufferedImage im=loadImage(file);
while (threadSuspended) {
Graphics2D g = (Graphics2D) getGraphics();
g.drawImage(im, 0, 0, this);
g.dispose();
}
Do I have to flush the BufferedImage too ? when ?
Thanks in advance