cancel
Showing results for 
Search instead for 
Did you mean: 

GUI_DispCharAt() and GUI_DrawCircle() always appear 2 pixel to the right on the LCD screen

Krautermann
Senior II

I am working on a STM32H745XI DISCO board and every time when I want to display text starting at the left edge on the screen, there is always a 2 pixel offset to the right. I have been looking around the whole code files; GUI.h, LCD.h, etc to find out the culprit for this offset, but in vain.

Has someone faced the same issue or know how to solve this?

Attached is the code that displays text and drawing:

void MainTask(void) {
  GUI_Clear();
  GUI_DrawGradientV(0, 0, 99, 99, 0x0000FF, 0x00FFFF);
  GUI_DrawGradientV(380, 172, 480, 272, 0x0000FF, 0x00FFFF);
 
  GUI_DispStringAt("Remove this offset please",0,0);
  GUI_DispStringAt("Hello world!", (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);
  GUI_DrawCircle(40, 231, 40);
 
 
  char storedvalueX[5], storedvalueY[5];
  itoa(LCD_GetXSize(), storedvalueX, 10);
  itoa(LCD_GetYSize(), storedvalueY, 10);
  GUI_DispStringAt(storedvalueX,100,50);
  GUI_DispStringAt(storedvalueY,100,GUI_GetFontSizeY()*4);
 
}

Even though I asked the microcontroller to display the text at coordinate (0,0) from line 6, there is around 2-3 pixels offset to the right, making the text not appear on the edge of starting screen. Same goes to drawing shapes. See picture attached for reference.

1 REPLY 1
Joe WILLIAMS
ST Employee

Hi Oliver

Your case is being internally addressed. We appreciate your patience and will be contacting you back shortly.

Kind Regards

Joe WILLIAMS

STMicro Support