Non-square pixel TFT and QML
-
I have a 800x480 TFT with rectangular pixels (0.19x0.18mm). When I draw a circle I get an oval.
I'm using Yocto on a AM62 SOM with in eglfs mode.
With widget app, I can set the window size to 851x480: since the window is forced full screen by eglfs, that 851 points are stretched in 800 pixels correcting the image aspect ratio.
With QML I cannot change the window size: the resize method has no effect, the size is always 800x480.
Please help. -
you want to look at scaling.
Item { id: scalingItem anchors.fill: parent transform: Scale { yScale: 19/18} Rectangle { width: 100 height: 100 radius: 50 color: 'red" } }
Untested, I hope you can get the idea.
@TomZ
Yes, that is the solution. It was also my first idea but for some reason I didn't make it work the first time, so I spent 3 days looking for other ways, from kernel to textures.
For anyone else having this kind of problem:Item { anchors.fill: parent transform: Scale { yScale: 1.065} //inverse of pixel ratio Item { id: mainQml width: 800; height: 451 //=480/1.065
-
-
@TomZ
Yes, that is the solution. It was also my first idea but for some reason I didn't make it work the first time, so I spent 3 days looking for other ways, from kernel to textures.
For anyone else having this kind of problem:Item { anchors.fill: parent transform: Scale { yScale: 1.065} //inverse of pixel ratio Item { id: mainQml width: 800; height: 451 //=480/1.065
@Landolfi how did you added your display to yocto?