How can I get the width and height of a picture?

I'm trying to make a script on RPG Maker XP that needs the width and height of an image to do some calculations. I tried @picture.bitmap.widthand @picture.bitmap.height but it returned the width and height of the image that is being shown in the screen.

For instance, if the image is 800 pixels height, and the image takes 400 pixels in the screen, @picture.bitmap.height will only return 400. This is the code I'm using:

@picture = Sprite.new
@picture.bitmap = RPG::Cache.picture("picture")
@pictureWidth = @picture.bitmap.width
@pictureHeight = @picture.bitmap.height

• What decides how many pixels it will take on the screen? Mar 1 '14 at 9:43
• The windows above it. Although I've realized what the problem was, as stated in my answer. Thank you so much for your attention, though.
– Gus
Mar 1 '14 at 20:21

1 Answer

I've realized what the problem was. I had made another picture, bigger than the screen size to test the script. But I forgot to import it to RMXP. Now that I've done that, it prints the correct value to the screen. Apologies for my lack of attention.