Quick question display_T35.SimpleGraphics.DisplayRectangle( )

Never used DisplayRectangle( ) before with a x and y corner radius other than 0, 0.

If I add a corner radius other than 0,0 the outline color is displayed but there is no fill color.

Is this normal?

Can you show the line of code?

@ Architect -

Sorry but Format as code menu is not working (IE and Chrome? on Windows 8.1)

        display_T35.SimpleGraphics.AutoRedraw = true;
        display_T35.SimpleGraphics.BackgroundColor  = 
                GT.Color.FromRGB(104, 255, 255);
        display_T35.SimpleGraphics.Clear();

        // Draws Solid Red
        display_T35.SimpleGraphics.DisplayRectangle(
            GT.Color.Red,       // outline color
            1,                              // outline thickness
            10, 10,                     // x, y
            50, 40,                     // width and height
            0, 0,               // x and y corner radius
            GT.Color.Red,       // gradient start color
            10, 10,                     // gradient start coordinate
            GT.Color.Red,       // gradient end color
            50, 40,                     // gradient end coordinate
            0xff);                         // opaque
            //0x00);                    // (transparent)
         
        //Draws Red border, Blue to white gradient
        display_T35.SimpleGraphics.DisplayRectangle(
            GT.Color.Red,       // outline color
            1,                              // outline thickness
            10, 10,                     // x, y
            50, 40,                     // width and height
            0, 0,                          // x and y corner radius
            GT.Color.Blue,       // gradient start color
            10, 10,                     // gradient start coordinate
            GT.Color.White,     // gradient end color
            50, 40,                     // gradient end coordinate
            0xff);                         // opaque
            //0x00);                     // transparent

        //Draws a Red border only, Fill is my background color
        //opaque or transparent makes no difference

        display_T35.SimpleGraphics.DisplayRectangle(
            GT.Color.Red,       // outline color
            1,                              // outline thickness
            10, 10,                     // x, y
            50, 40,                     // width and height
            10, 10,                     // x and y corner radius
            GT.Color.Blue,       // gradient start color
            10, 10,                     // gradient start coordinate
            GT.Color.White,     // gradient end color
            50, 40,                      // gradient end coordinate
            0xff);                          // opaque
            //0x00);                      // (transparent)

I have tried different width/height and corner radius. Always shows only the border if radius is other than zero.

Windows 8.1 64 bit, FEZ Raptor, T35 Display, VS 2012 for desktop

I was trying to draw some buttons

@ willgeorge - I have just tried the following example (using Bitmap class instead of the display module). I have run it using emulator. I see the same result. As soon as the corner radius is not 0 the function ignores fill color(s).


        Bitmap display = new Bitmap(320, 240);
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            display.Clear(); 
            // Draws Solid Red             
            display.DrawRectangle( GT.Color.Red, // outline color 
                1, // outline thickness 
                10, 10, // x, y 
                50, 40, // width and height 
                0, 0, // x and y corner radius 
                GT.Color.Red, // gradient start color 
                10, 10, // gradient start coordinate 
                GT.Color.Red, // gradient end color 
                50, 40, // gradient end coordinate 
                0xff); // opaque 
                //0x00); // (transparent) 
            //Draws Red border, Blue to white gradient 
            display.DrawRectangle( GT.Color.Red, // outline color 
                1, // outline thickness 
                61, 10, // x, y 
                50, 40, // width and height 
                0, 0, // x and y corner radius 
                GT.Color.Blue, // gradient start color 
                61, 10, // gradient start coordinate 
                GT.Color.White, // gradient end color 
                50, 40, // gradient end coordinate 
                0xff); 
                // opaque //0x00); // transparent 
            //Draws a Red border only, Fill is my background color 
            //opaque or transparent makes no difference 
            display.DrawRectangle( GT.Color.Red, // outline color 
                1, // outline thickness 
                111, 10, // x, y 
                50, 40, // width and height 
                1, 1, // x and y corner radius 
                GT.Color.Blue, // gradient start color 
                0, 0, // gradient start coordinate 
                GT.Color.Blue, // gradient end color 
                0, 0, // gradient end coordinate 
                ushort.MaxValue); // opaque 
                //0x00); // (transparent)

            display.Flush();
        }

I don’t know if this by design or a bug. In any case the documentation should reflect this if it is by design or it should be fixed if this is a bug.

I would report this on NETMF codeplex site.

@ Architect -

Thank you…

At least it is not me!

Yep. You are welcome!

@ Architect -

Took your advice and reported on Codeplex
(I used your code for emulator because it does not need the hardware display)

https://netmf.codeplex.com/workitem/2162

1 Like

Great! Thank you.