I’m having a play with the android sdk for the first time, trying to get render some sprites from a spritesheet (.png), but the image is shrinking when I import it into the project – the image that I’m working from is 1330px wide, but when I run the app and output getWidth() it is showing as 998px
This is causing errors because I’m trying to crop specific areas of the image and it keeps crashing with the exception java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
Can anyone advise how I can deal with this?
If you put the image in the resources folder, it will be scaled to fit the screen when you use it.
To avoid this, put the image in the assets folder and load it as Bitmap, this way it won’t be scaled.