Graphics image scaling
-
Is there a way to scale an image in a paint routine? Ideally I'd like to be able to set a ratio that is automatically adjusted, as we can for component filmstrips.
-
@d-healey Necrobump
-
Doesn‘t it already scale to the dimensions you pass in the drawImage function?
-
@Christoph-Hart No, it maintains the ratio. It also asks for xOffset and yOffset, because the idea for the method is to also be able to manually implement one or multiple strips and scroll through them using the offsets.
What David is after (and me too) is an option to input a float scaleX and scaleY that would scale the image inside the given area.
Ideally it also takes alignment (like the drawAlignedText), else animating becomes a nightmare.
Of course, for backwards compatibility, this would be a new method, g.drawImageScaled or something
-
@aaronventure but why on earth would you want to draw an image with a odd scale ratio between width and height. I know that's technically possible, but I always thought of it as the demonstration of the previous state of a "how can I draw an image correctly"?
-
@Christoph-Hart Recreating animations using smaller elements... "Funny" animations, etc.