Announcement

Collapse
No announcement yet.

Dimming the whole screen behind a dialog

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

  • Dimming the whole screen behind a dialog

    Hello,

    I use uLCD-43PT with version 33 PmmC.

    SSD1963 on this model has 1215k frame buffers, so I can save
    the whole image before showing a dialog and restore it after just fine
    and quick with gfx_ScreenCopyPaste.

    I would like now to dimm the screen content behind a pop-up dialog before showing it.
    Is there any convenient and performant way to do that?

    I know about the following things:

    1. gfx_ChangeColor putpixel -> it is ok for all but dead slow
    4. disp_WrGRAM may a little bit better than put pixel, but still dead slow

    I tried to find some direct function of the SSD1963 controller chip, but
    without any result. (http://www.allshore.com/pdf/solomon_systech_ssd1963.pdf)

    It is also unclear to me how can I send direct commands to the SSD chip which requires
    parameters. disp_WriteControl just works fine for command without parameters
    like "Enter Invert Mode":

    disp_WriteControl(SSD1963_ENTER_INVERT_MODE);
    pause(1000);
    disp_WriteControl(SSD1963_EXIT_INVERT_MODE);

    Could you tell me how to pass parametes for other commands
    or how the get the output parameters?
    Using some advanced features, e.g: scrolling would be great.

    Thanks,
    Mris

  • #2


    2 is probably going to be your best bet, redrawing the text in a darker color.

    disp_WriteControl(SSD1963_REGISTER);
    disp_WriteWord(SSD1963_DATA); // do as many times as required

    Similarly use x := disp_ReadWord(); to read values
    Mark

    Comment


    • #3
      I brought this topic to focus again and I did some experiment with masking the background with check table pattern instead of changing the color of the background. It work similar from a decent distance, e.g 50cm. And works faster than the two methods above.
      My first implementation was a check table pattern image with transparent color:

      Code:
          gfx_TransparentColour(TRANSPARENT_COLOR);
          gfx_Transparency(ON);
          img_Show(hndl, iDIMM_MASK);
      It takes 190mS to load from the SD card and show it as a dimm mask.

      Then I tried the line pattern with horizontal lines and rectangles.
      This one give nice effect and takes 184mS:

      Code:
        
          gfx_LinePattern(0xAAAA);
          var i;
          for (i := 0; i < 76; i++)
              gfx_Rectangle(i ,i, 479-i, 271-i, BLACK);
          next
          gfx_LinePattern(0);
      Finally I did patterned line only outside the dialog.
      It can be drawn after the dialog is done, so the visual experince is better.
      It takes 152mS for my avarage dialog size:

      Code:
          var dx1, dx2, dy1, dy2;
          dx1 := 74;
          dx2 := 405;
          dy1 := 49;
          dy2 := 222;
      
          gfx_OutlineColour(BLACK);
          gfx_Panel(PANEL_RAISED, dx1, dy1, dx2-dx1+1, dy2-dy1+1, COLOR_DIALOG_BG);
      
          var i;
          gfx_LinePattern(0xAAAA);
          for (i := 0; i < dy1; i++)
               gfx_Line(0, i, SCREEN_X_SIZE-1, i, BLACK);
          next
          for (i := dy1; i < dy2+1; i++)
               gfx_Line(0, i, dx1, i, BLACK);
               gfx_Line(dx2+1, i, SCREEN_X_SIZE-1, i, BLACK);
          next
          for (i := dy2+1; i < SCREEN_Y_SIZE; i++)
               gfx_Line(0, i, SCREEN_X_SIZE-1, i, BLACK);
          next
      
          gfx_LinePattern(0);
      The result can be seen here: (original background, dimmed, dialog with dimmed background)


      Attached Files

      Comment

      Working...
      X