Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 3:34 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Jul 07, 2010 12:30 pm 
Offline

Joined: Wed Jan 07, 2009 9:20 pm
Posts: 41
Happens when creating a BigImage from a large jpg file (I have not tested other formats). The image is padded in black up to the next multiple of 512 pixels.

For example, I have this 1024x640 pic loaded into a BigImage. When I draw it, there is no horizontal padding (since 1024 is an exact multiple of 512) but there is a good amount of vertical padding (filling pixels 641 to 1024 which is the next multiple of 512). What's annoying is that this padding is opaque black.


Temporary workaround until the bug is resolved:

Take the BigImage object you have created, and call the subImage method on it with the image's dimensions, like this:

Code:
BigImage tempImage = new BigImage("field.jpg");
BigImage image = tempImage.getSubImage(0, 0, tempImage.getWidth(), tempImage.getHeight());


The resulting image has no padding, so apparently subImage does something good that the regular image creation does not.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 14, 2010 12:35 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Fixed in SVN.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group