wood burning stoves 2.0*
The moose likes Game Development and the fly likes Graphics2D.drawImage(Image,x,y,ImageObserver): More Efficience on Small v. Large Images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Graphics2D.drawImage(Image,x,y,ImageObserver): More Efficience on Small v. Large Images" Watch "Graphics2D.drawImage(Image,x,y,ImageObserver): More Efficience on Small v. Large Images" New topic
Author

Graphics2D.drawImage(Image,x,y,ImageObserver): More Efficience on Small v. Large Images

Ike Gentz
Greenhorn

Joined: Jan 01, 2013
Posts: 15
I have this game I am working on and it uses parallax scrolling. The thing I'm wondering is if there is a noticeable performance gap between calling drawImage(Image,x,y,ImageObserver) on a bunch of smaller Images which would make up the background, or calling drawImage(Image,x,y,ImageObserver) on one large Image.

In context, the size of the images would be 1920 x 1080 for if I was making a call and just drawing one large image at a time, v. using maybe around 40 x 40 images, but enough of them to fill up a 1920 x 1080 space. Any insight here on which would be more efficient or what would be the optimal image size : number of images drawn ratio? Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Graphics2D.drawImage(Image,x,y,ImageObserver): More Efficience on Small v. Large Images