Main Site Documentation

LCD Portrait Orientation


#1

Anyone know how to rotate the screen +/- 90 degrees?
Ideally this rotation would apply to both the SimpleGraphics and the WPFWindow.


#2

Yes you can, and only on GHI devices :slight_smile:

Advanced uses may not be built in gadgeteer libs but they are still there if you need them. I suggest you take a look here and see what is available.
http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/Index.html


#3

Gus

I created a Gadgeteer application with only the Display_T35.
I added a reference to GHIElectronics.NETMF.Hardware.
When I run the code below, nothing happens (the startup banner remains on the display).
When I comment out the constructor, the display shows a small red circle (landscape mode).
Any suggestions?


using GHIElectronics.NETMF.Hardware;
using Microsoft.SPOT.Presentation.Media;

namespace GadgeteerPortrait
{
    public partial class Program
    {
        public Program()
        {
            Configuration.LCD.SetRotation(Configuration.LCD.Rotation.Rotate_CW_90);
        }

        void ProgramStarted()
        {
            display.SimpleGraphics.DisplayEllipse(Colors.Red, 100, 200, 10, 10);
        }
    }
}


#4

Try moving the configuration change to the ProgramStarted() method. Having it in the constructor may be to early in the initialization cycle.

There may be a conflict between the based NETMF libraries and the Gadgeteer library on rotating the display. You might have to go to the Gadgeteer code to see what is happening. Might necessitate a request for a rotate feature.


#5

Mike

Been there, done that, same result - which is what caused me to move it to the constructor in the first place… the docs say to call this before initializing any WPF code.

Guess it is time to figure out how Bitmap.RotateImage works… now if I can only find the docs for that function, because it certainly acts different than I would expect - but that is a different topic.

  • John

#6

John

The Gadgeteer libraries does a lot under covers to make it “easy” for the user. I have spent a lot of time looking at the library code to better understand what is happening.

At the present time, the only complete documentation is within the code base, in metadata format, but it is readable.

The SimpleGraphics interface is just that…

You can not get access to the Bitmap that is used by the Gadgeteer library. If you want to do fancy stuff, like rotate, you have to build your own bitmap and then draw the bitmap onto the display. Uses double the memory, but it is fast.