newImageRect vs newImage (aspect ratio)

Forgive me if this has already been asked – I couldn’t find the answer anywhere.

When I’ve used newImage in the past, I never had to specify the resolution; however, with newImageRect, I do. I am loading a number of graphics in a loop, each with different resolutions. Is there any way to determine what the image resolution is, so I can feed the proper w/h parameters to newImageRect? Or is there any way of fixing the aspect ratio on newImageRect (i.e. test.png is a 4:3 image, so if I set the width to 400, the height will automatically be set to 300)?

-Stephen [import]uid: 87249 topic_id: 19296 reply_id: 319296[/import]

What you can do is first display the image using th eregular newImage, get the height/width and store them in locals, delete the image and redisplay it using the newImageRect and specifying the height/width with the variables [import]uid: 14018 topic_id: 19296 reply_id: 74417[/import]

Yeah I thought of that – I was worried that it would be too inefficient loading each image twice. Are there any performance pitfalls I should be worried about following this method? [import]uid: 87249 topic_id: 19296 reply_id: 74419[/import]