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

    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:
    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:

    Please help me to solve my problem


    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
    • xxx.gif

      1.17 kB, 150×150, viewed 323 times
  • 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.


    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.