Announcement

Collapse
No announcement yet.

Transparent color with Picadillo 35t

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transparent color with Picadillo 35t

    Hi everybody, can someone tell me if there is a way to set the "transparent" color ? I need to print some text over a bmp image and i don't want to see a colored rectangle around the text

    For example, i use the following command : tft.setTextColor(Color::LimeGreen, Color::Black);

    I'd like to set (Color::Transparent) but after reading the "color.h", it seems there is nothing provided for this.


    Regards, David.


  • #2
    If you set the foreground and background to the same colour it takes the background as transparent.

    tft.setTextColor(Color::LimeGreen, Color::LimeGreen);

    Comment


    • #3
      Yes it works fine, thanks a lot !

      One more victory for Majenko !

      Comment


      • #4
        Oh, finally this is not a real victory.
        It works fine to print a 'static' text, but not to print an evoluting value.

        When i print a temperature, i get for example 21.7 and when the value is changing to 21.8 the 8 comes over the 7 but the 7 stays behind the 8
        I can maybe clear the line and print new value after but it will not be beautiful to see.

        An idea ?

        Regards, David.
        Last edited by Dagui; 11th October 2014, 10:00 PM.

        Comment


        • #5
          Well, that's what transparent text does - it doesn't affect what is already there in the empty spaces. Just like writing with a pen

          You'll have to get out the tip-ex ("whiteout") and erase what was there before.

          You could experiment with some double buffering using a small framebuffer to pre-generate that section of the display (including the background) and then paste the whole thing down in one operation.

          Comment


          • #6
            ... except there is a small bug in it at the moment which I am just correcting. I'll upload a fixed version of the library, along with a new DoubleBuffer demo sketch, momentarily.

            Comment


            • #7
              OK, on GitHub is a new fixed version. You can take a look at the DoubleBuffer Picadillo example to see how to work with framebuffers. Basically, anything you can do on a TFT you can do on a framebuffer, and then you output the framebuffer to the screen at the coordinates you choose.

              Comment


              • #8
                Hello, thanks a lot for what you do, it's really nice.
                I cannot try this for the moment because of not enough free time this week and, to be honest, i'm not sure to understand completely.

                But i will try and then maybe try again and again and then I'll keep you posted.

                Greetings from France

                Comment


                • #9
                  It's a simple enough concept. The framebuffer is like a little image file in memory that you can draw in. You do your drawing operations (paste in the background image - or part of it, write your text over the top, etc) and it does it all in memory with nothing displaying to the screen at all.

                  Then, once you have done all the drawing you "update" (or draw) the framebuffer to the screen. The whole framebuffer image is then displayed using ultra fast windowing operations, so you can get a nice smooth display without any flicker at all. Depending on the size of the framebuffer it's possible to get many frames per second (too fast to see individual frames really).

                  The size of the framebuffer you can use is dependant on what memory you have available, so keep it as small as you can really. Also, a framebuffer can be used multuple times in multiple locations with different graphical data in it each time, which can save huge amounts of memory

                  Comment

                  Working...
                  X