01-31-2023, 02:46 PM
One thing you need to determine to begin with is to decide if scaling is the bottleneck in your performance, or if it's just a case of the larger image sizes. Keep in mind that an image 2x the size uses 4x the memory and processing power. An image 3x the original size used 9x the memory and processing power.
For example, let's take a simple 10x10 pixel image and scale it by a factor of 3. That's now a 30x30 pixel image, for a total of 900 pixels to process, compared to the 100 the original picture had.
If you're certain the scaling is the issue and that's what's bottlenecking your performance, then simply prescale your images.
INPUT "How much do you want to scale your image? "; scale%
scaledImage = _NEWIMAGE(_width(originalImage)* scale%, _height(originalImage) * scale%, 32)
_PUTIMAGE ,originalImage, scaledimage
^Now you have the image prescaled and can just _PUTIMAGE the contents to the screen without having to constantly resize on the fly.
For example, let's take a simple 10x10 pixel image and scale it by a factor of 3. That's now a 30x30 pixel image, for a total of 900 pixels to process, compared to the 100 the original picture had.
If you're certain the scaling is the issue and that's what's bottlenecking your performance, then simply prescale your images.
INPUT "How much do you want to scale your image? "; scale%
scaledImage = _NEWIMAGE(_width(originalImage)* scale%, _height(originalImage) * scale%, 32)
_PUTIMAGE ,originalImage, scaledimage
^Now you have the image prescaled and can just _PUTIMAGE the contents to the screen without having to constantly resize on the fly.