2021-04-30 09:54 AM
Hi there,
I am using a 800x480 display that does not have square pixels. Therefore, my custom containers are always "stretched" along the y-axis. This is not a problem for static images in my container, since I can scale the image before on the PC side. However, for more complex assets, like images that need to be rotated, I cannot scale the images on the PC side because the scaling needs to change depending at what angle the image is rotated. In other words, the image needs to be scaled dynamically along the y-axis only. Is there a way to do that with TouchGFX?
2021-04-30 01:21 PM
I use this on scalable image
background.setWidth(2*background.getWidth());
background.setScalingAlgorithm(touchgfx::ScalableImage::NEAREST_NEIGHBOR);
2021-04-30 01:38 PM
I don't think this will work with any widget though (I tried on my custom container, and it does not rescale the image, it just crops the container to whatever width/height you set it to).
Thank you for your input though.
2021-05-01 12:38 AM
Oh yes you ask widget but write about images. Widgets except scalable image cant be rescaled only resized as you write result is crop.
2021-05-03 01:03 AM
Hello YTalh,
As MM..1 mentioned, you cannot re-scale widgets like this. The only widgets that are re-scalable are only the scalable image, the zoomAnimatedImage and the Texture Mapper. Scaling requires a lot of MCU power so I would suggest you to avoid using it too much depending on which MCU you're working on.
/Alexandre