Hero image

Scaled Image

What the code does

This demo loads an image and then dynamically rescales it in size on each frame within a for loop. Scaling is acheived by modulating the destination rectangle in which the image will be draw to on the screen. It demonstrates automatic texture scaling in PTB. By default bilinear filtering is used to rescale the texture. The image never gets larger than the maximum needed for the image to span the fully height of the screen. 

Visualisation

The code

Instagram image Instagram image Instagram image Instagram image Instagram image Instagram image