display.newImageRect is designed to be flexible with regard to screen dimensions, so that I can specify the rectangle rather than just having the image load at whatever pixel size it is. But I need a slightly different form of flexibility.
My display routine loads one page at a time for my tutorial. Each page may contain an image, which will be loaded from a file. But not all images have the same aspect ratio. Some are square, some are wider. So here’s what I’d really like to do:
-
Ascertain the pixel dimensions of my image file.
-
Calculate a rectangle based on the screen size, the image shape, and my algorithm for “what looks good”.
3. display.newImageRect using that rectangle.
It would also work to load the image and then change its width and height, if that is possible and if I can discern the original image dimensions.
Question 1: Can I do this under the old graphics model? I inherited some legacy code, and I’d really rather not have to convert it to the new graphics model.
Question 2: Is there a better way to do this under the new graphics model?
Thanks,
Ken