Skip to main content

What is the proper way to compare drawing a BufferedImage and drawing an Image with BufferStrategy?

2 replies [Last post]
Anonymous

In a test applet, I can draw a BufferedImage or an Image using
BufferStrategy. Drawing with BufferStrategy is more than 3
times faster than just a straight drawImage() with a BufferedImage.

Am I doing a proper comparison? I thought BufferedImage's did
all the acceleration for you. Or was that just the double buffering?
What is a more true way to compare the drawing?

Here's the paint() method:

public void paint(Graphics g)
{
// System.err.println("paint()");
try
{
if(!this.isShowing())return;
g.drawImage(bufferedImage,0,0,thisW,thisH,this);

// do {
// do {
// bg = (Graphics2D)bs.getDrawGraphics();
// bg.drawImage(canvasImage, 0, 0, thisW, thisH, this);
// bg.dispose();
// } while (bs.contentsRestored());
// bs.show();
// } while (bs.contentsLost());
}
catch (Exception ie)
{
ie.printStackTrace();
}
}

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linuxhippy
Offline
Joined: 2004-01-07
Points: 0

Don't know if you know Chet Haase's Blog entry about buffered images:
http://weblogs.java.net/blog/chet/archive/2003/08/bufferedimage_a_1.html

lg Clemens

Ken Warner

Thanks but that's really old stuff. And I don't think much
of what is promised has happened. If you look at my applet,
BufferedImage's draw slower than plain old Image's.

BufferStrategy is a fairly good interface for VolatileImage's
with some glitches showing up on full speed rendering loops.

Seems to me that a lot more could be done now. Graphics cards
are available with lots'o'vram these days. Thanks to the gamers.

I just don't see BufferedImages as a real perfomance gainer....

java2d@JAVADESKTOP.ORG wrote:
> Don't know if you know Chet Haase's Blog entry about buffered images:
> http://weblogs.java.net/blog/chet/archive/2003/08/bufferedimage_a_1.html
>
> lg Clemens
> [Message sent by forum member 'linuxhippy' (linuxhippy)]
>
> http://forums.java.net/jive/thread.jspa?messageID=285580
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".