Loading ...
Sorry, an error occurred while loading the content.

5596Re: [nuttx] Re: NxWidgets transparent text

Expand Messages
  • Toby Duckworth
    Mar 29, 2014
    • 0 Attachment
      Hi Greg,

      Many thanks for the information.
      I have now solved the problem and will soon send you a patch to fix the reading of LCD data back from the MI0283QT9A display, which it appears was broken in my previous submission of the driver.

      Thanks again,
      Toby



      On 27/03/2014 14:10, spudarnia@... wrote:
       

      Hi, Toby,

      > I'm having a problem convincing NxWidgets to draw text correctly.
      > Specifically, each glyph is drawn with a black background, even when I
      > specify CONFIG_NXWM_TRANSPARENT_COLOR as black.

      Transparent character backgrounds are achieved by reading the background rectangle form the display, adding the character glyph into the background rectangle, and then writing the background rectangle back to the display.

      The normal reason that this does not work is that the LCD drivers getrun() method is broken and is returning garbage (or zeroes) for the background.  So when you write the rectangle back to the display, the font background becomes corrupted (black).  Have you verified that you can read data from the display?  There is a test at apps/examples/lcdrw that can be used to verify if you can read from your display or not.  You should run it.

      Many LCDs cannot support reading the display content.  Some SPI-based LCDs, for example, have MOSI but no MISO lines making them inherently write-only.  If you cannot read from your display, than you should set CONFIG_LED_NOGETRUN in the Drivers -> LCD menu.  That tells the system the the LCD does not implement the getrun() method (or does not implement it correctly).

      CONFIG_NX_WRITEONLY should also be set, but that should get set automatically when you select CONFIG_LED_NOGETRUN.

      When CONFIG_LED_NOGETRUN is set, the graphics system will not try to read from the LCD.  Instead, it will simply substitute the a fixed color for in the rectangular region.  This, obviously, will work okay unless the real background has a different color or is an image.

      [Hmmm.. I notice that the Kconfig file is empty for apps/example/lcdrw.  I will flush that out today.]

      > Interestingly, when I refer to the chexcalculator.cxx demo, I find that
      > in this, the same font is used by the button array as the calculator's
      > display.
      > Each button renders the text incorrectly, whereas the calculator display
      > renders it correctly.
      >
      > Could it be that simply text rendering in buttons is broken, whereas a
      > Label renders correctly.

      Anything is possible.  The calculator display is a CTextBox and the buttons are CButtonArray.  Both worked okay the last time that I used them, but that has been awhile.

      Greg


    • Show all 3 messages in this topic