Problem in using GUI_CURSOR_SetPosition

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Problem in using GUI_CURSOR_SetPosition

    Hi
    I have a joystick with 2 analog output 0 volts to 3 volts as X and Y axis .I want to use ADC for moving the cursor on the lcd.At first, I want to set the position of the cursor manually .The size of the lcd is 7 inch with SSD1963 driver.
    everything is good for showing text,button,icon,.... on the lcd , but when I use GUI_CURSOR_SetPosition() for changing the position of cursor on the lcd on the white background color , Black color line created after the cursor movement.I use WM_MOUSEOVER message for refreshing the window region as below:
    WM_InvalidateWindow(WM_GetClientWindow(_hFrame));
    But it does not work.
    I think the problem is the reading the color of the background of lcd because of invalid setup the color format of lcd.

    I setup the color section of LCDConf.c as below:
    #define COLOR_CONVERSION GUICC_565
    #define DISPLAY_DRIVER GUIDRV_FLEXCOLOR

    Please help me to solve my problem

    Regards

    The post was edited 1 time, last by tictactoe ().

  • Hi,

    I assume reading of the display does not work. If using GUIDRV_FlexColor it should either work with a display cache or it must kept sure that reading pixel data from the controller works right. You could check if reading works right by the following test:

    Source Code

    1. void _Test(void) {
    2. const int dx = 50;
    3. const int dy = 50;
    4. const GUI_COLOR aColor[] = { GUI_RED, GUI_GREEN, GUI_BLUE };
    5. const char * apText[] = {
    6. "Red", "Green", "Blue"
    7. };
    8. GUI_RECT Rect = { 0, 0, dx - 1, dy - 1 };
    9. int i;
    10. GUI_SetTextMode(GUI_TM_TRANS);
    11. for (i = 0; i < GUI_COUNTOF(aColor); i++) {
    12. GUI_SetColor(aColor[i]);
    13. GUI_FillRectEx(&Rect);
    14. GUI_SetColor(GUI_WHITE);
    15. GUI_DispStringInRect(apText[i], &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
    16. GUI_MoveRect(&Rect, dx, dy);
    17. }
    18. GUI_MoveRect(&Rect, -dx, -dy);
    19. GUI_InvertRect(dx / 4, dy / 4, Rect.x1 - dx / 4, Rect.y1 - dy / 4);
    20. GUI_MoveRect(&Rect, -dx, -dy);
    21. GUI_InvertRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
    22. }
    Display All


    The attached screenshot should show the expected output.

    Regards, Jörg
    Images
    • xxx.gif

      1.17 kB, 150×150, viewed 635 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,
    Thanks you for the answer.
    I test your code, but the white box is Violet. The joint's color of two box does not change and it seems that the violet box is on the top of other boxes .
    So I think the reading pixel data from the controller does not work right.

    Regards
  • Hi Jörg
    Sorry for late answering. At first I should say I am using emwin 5.26
    I test your code again with my STM32F103 dev board.(LCD 7 inch with ssd1963)

    The red box is showing blue
    The green box is showing green
    The blue box is showing red

    Its the picture of your sample code


    I attach the related files with my problem . please help me for the incorrect code settings.

    Regards
    SSD1963_lcdconf.zip

    The post was edited 2 times, last by tictactoe ().

  • Hi
    Finally with some changes in ssd1963 and lcdconf files, the color was corrected and the result of the code in my hardware was as same as your result test.
    But the color of the cursor is still black and the shape of the cursor was drawn on the screen.

    Please help me to correct this.

    Regards
    Hamed