The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Loading images in the least amount of time

Posted by Hiran on November 28, 2001 at 10:19 AM

How do I load an image quickly? For solitaire, I have to load the images of each card face. Here's my code to draw each image:


Toolkit toolkit = Toolkit.getDefaultToolkit();
Image cardFace = toolkit.getImage(cardImagePath);
g.drawImage(cardFace, borderWidth, borderWidth, dim.width - 2 * borderWidth - 1, dim.height - 2 * borderWidth - 1, this);

(Note: g is a Graphics object)


Is there any way to load the images faster? Thnx in advance.
Hiran



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us