scaling an image according to screen resolution

Blitz3D Forums/Blitz3D Beginners Area/scaling an image according to screen resolution

The example I gave assumed the aspect ratio remained unchanged so in this case you would have to amend the y scale.

ScaleX# = Graphicswidth() / 1280.0
ScaleY# = graphicsheight() / 1024.0

If you're keeping the same aspect ratio, as I said above the scale is correct for both x and y.

e.g. An image is 128 x 128 @ 1280 x 1024 res and you want to scale to a appear the same size relative to 640x480 screen res ..

ScaleX# = 640.0 / 1280.0 = .5
ScaleY# = 480.0 / 1024.0 = .46875

scaleimage Image, ScaleX, ScaleY would reduce the image to 64 x 60 pixels.

For best results I would still stick to one aspect ratio though.

Stevie