cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Portrait Orientation on STM32F746G-Discovery Kit

scottSD
Senior III

I have followed the instructions in the following link:

https://touchgfx.zendesk.com/hc/en-us/articles/203563972-Display-Orientation

It gives instructions for portrait orientation for the target (via editing BoardConfiguration.cpp) , Simulator (via via editing the simulator's main.cpp file), and the TouchGFX Designer (via editing the project file).

I believe the instructions are not up-to-date (especially for the Designer).

TouchGFX Designer:

Swapping the Width and Height values in touchgfx project file did not put the Designer in portrait mode. I also needed to change the "DisplayOrientation" to "Portrait" (in the touchgfx project file) :

"LandscapeSkinX": 0,
    "LandscapeSkinY": 0,
    "PortraitSkinX": 0,
    "PortraitSkinY": 0,
    "DisplayOrientation": "Portrait"

TouchGFX Simulator

The simulator did function correctly in portrait when adding the following to its main.cpp file:

HAL::getInstance()->setDisplayOrientation(ORIENTATION_PORTRAIT);

However, items are distorted on the simulator:

0690X00000AtPEwQAN.pngThis is what it looks like in the Designer: 

0690X00000AtPF1QAN.png

The "R" is an Image widget I added.

The target shows the same thing as the image above (after editing the BoardConfiguration.cpp file).

Is there anything I can do to fix the distortion of the widgets?

1 ACCEPTED SOLUTION

Accepted Solutions

Further experimenting helped me find an answer to this. Hopefully it will help anyone else that is having issues with Display Orientation.

Go to the Images tab in the Designer:

0690X00000AtPG4QAN.png

In the right margin set the Layout Rotation to 90:

0690X00000AtPG9QAN.png

And it fixes my issue:

0690X00000AtPGEQA3.png

View solution in original post

4 REPLIES 4
scottSD
Senior III

I was able to fix the "R" image by appending ".90" to the image file name prior to adding to the Designer. The article says in the "Switching Dynamically at Runtime" section that this can be done so that the image will be rotated 90 automatically.

Further experimenting helped me find an answer to this. Hopefully it will help anyone else that is having issues with Display Orientation.

Go to the Images tab in the Designer:

0690X00000AtPG4QAN.png

In the right margin set the Layout Rotation to 90:

0690X00000AtPG9QAN.png

And it fixes my issue:

0690X00000AtPGEQA3.png

Nice walkthrough 🙂

With this, do you think it would be possible to switch between landscape and portrait during runtime - using an accelerometer data? This would be interesting to test!

The article I provided in the opening post (https://touchgfx.zendesk.com/hc/en-us/articles/203563972-Display-Orientation) does talk about doing this dynamically. With what I found out about the images needing to be set at 90 at design time, I assume that in order to switch this dynamically, one would need a set of landscape images and a set of portrait images and switch the images for each widget when switching between modes.

when I get some time, I will test it.