GUI_AA_FillCircle acting strange.

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

    • GUI_AA_FillCircle acting strange.

      If I try to draw AA circle using following code, the result in circle image has one transparent line.

      Originally I was try to create a button with custom background drawing which has rotating round image depending on system condition.

      But soon after I complete my code I discovered that depending on drawing position of circle drown by "GUI_AA_FillCircle()" shows

      one transparent line in the middle of circle.

      Following are part of my code and it's result on simulation system also.
      --> Library I used was "STemWin_CM7_wc32_ot_ARGB.a" and also simulation library from Segger V5.40

      Please help to find out what is wrong with it.


      void _cbAutoButton(WM_MESSAGE *pMsg)
      {
      switch(pMsg->MsgId) {
      case WM_CREATE:
      break;

      case WM_PAINT:
      GUI_SetBkColor(GUI_BLACK);
      GUI_Clear();
      GUI_AA_EnableHiRes();
      GUI_AA_SetFactor(4);
      GUI_AA_SetDrawMode(GUI_AA_NOTRANS);
      GUI_SetPenSize(3);
      GUI_SetColor(GUI_BLUE);
      GUI_AA_FillCircle(251, 237, 20 * 4);

      GUI_AA_DisableHiRes();
      break;

      case WM_TIMER:
      //WM_RestartTimer(pMsg->Data.v, 200);
      //WM_Paint(pMsg->hWin);
      break;

      default:
      WM_DefaultProc(pMsg);
      break;
      }
      }

      void MainTask(void)
      {
      int fr = 0;
      uint32_t fpos = 0;
      GUI_Init();
      GUI_SetBkColor(GUI_WHITE);
      GUI_Clear();
      WM_CreateWindow(710, 0, 80, 80, WM_CF_SHOW, _cbAutoButton, 0);

      while(1) {
      GUI_Delay(100);
      }
      }
      Images
      • 2.png

        31.1 kB, 659×417, viewed 97 times
      • img1.png

        28.15 kB, 870×634, viewed 95 times
    • Hello,

      I think it's because your y0 parameter in your GUI_AA_FillCircle() is not a multiple of the factor (4) you selected when using hi-res coordinates. Setting y0 to a closest multiple value (236 or 240) solves this problem on my side.

      Also you are using "STemWin_***_ARGB.a" library and I noticed that setting circle color to a blue shows red circle on your screenshot.
      You need either to change lib file to "STemWin_***_ABGR.a" or configure special macro in a header file for using argb mode.

      Alex.