Jump to content

  • Log In with Google      Sign In   
  • Create Account


Bitmap size problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 elle_lawliet   Members   -  Reputation: 100

Like
0Likes
Like

Posted 08 April 2012 - 01:23 PM

Hi! I'm trying to load a .PNG image from the SD card (OS: android 2.2). It loads ok, but when I check the size, it's a little smaller than the original (the original size is 36x36 and the loaded is 27x27 bits, also looks smaller in the screen)

This is what I'm using to load the image

this.bmp = BitmapFactory.decodeResource(this.game.getResources(),this.id);
if(bmp==null)
System.out.println("Cannot load the image");
this.pixelsX = bmp.getWidth();
this.pixelsY = bmp.getHeight();

Also, if I load a 24x24 image, pixelsX & pixelsY get 18 each one.
Is this somethig decodeResource do by itself? I need it to be the right size for each bitmap.

Hope you can help me ;)

Sponsor:

#2 Zael   Members   -  Reputation: 154

Like
0Likes
Like

Posted 10 April 2012 - 11:13 AM

I may be wrong, but I seem to remember some automatic resizing that took place when I loaded images like that in my Android game. Most image files have a PPI (pixels per inch) value, and if I recall that method resizes the image so that it is the same physical size by comparing the image's PPI and the device's PPI.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS