2D graphics primitives

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

    • 2D graphics primitives

      Hi I have just started to get my feet wet with STemWin, bundled in STM32CubeMX. emWin version is 5.44+, running on an stm32f7 discovery board (STM32F756, and 480x272 LCD).
      Because maybe I'd like to use it professionally, once I have experience with it.

      Unfortunately, I run into some issues, and I have some questions.

      - When drawing these shapes: GUI_DrawRect, GUI_DrawRoundedRect, and GUI_DrawCircle, the PenSize is ignored, but other shapes use it. The size was reduced to 1 for these shapes.
      Is it expected behavior? Is there a way to set the pen size for above shapes?

      - AA variants seem top have the right PenSize, however using GUI_AA_DrawCircle, shows a circle where the outer edges are clipped off, see attached picture.
      Is there a way to get the shape drawn right?

      - GUI_DrawEllipse does not seem to have an 'AA' variant aka GUI_AA_DrawEllipse.
      Or is it there?

      STemWin version 5.44+ is the latest version available for ST platforms.
      Is it too old?
      Could I update it?

      My source is here:
      github.com/bkht/STemwin-on-stm32f7-dicovery

      Thank you very much for helping me out.
      Images
      • 20190407_164413.jpg

        45.52 kB, 379×381, viewed 442 times

      The post was edited 12 times, last by Jack74044 ().

    • Hi,


      Jack74044 wrote:

      The size was reduced to 1 for these shapes.
      Is it expected behavior? Is there a way to set the pen size for above shapes?
      Yes, this is the expected behavior. Unfortunately, it is not possible to set a pen size for these shapes. Instead of drawing a circle you can draw an arc which covers 360°, for this shape you can set a pen size. A simple rectangle can be drawn multiple times.


      Jack74044 wrote:

      AA variants seem top have the right PenSize, however using GUI_AA_DrawCircle, shows a circle where the outer edges are clipped off, see attached picture.
      Is there a way to get the shape drawn right?
      Where does it get clipped? Do you draw it into a window or a memory device? If yes, enlarge the window or device. Of course you could also reduce the radius of the circle by the pen size.


      Jack74044 wrote:

      GUI_DrawEllipse does not seem to have an 'AA' variant aka GUI_AA_DrawEllipse.
      Or is it there?
      Unfortunately, there is no AA version of GUI_DrawArc().

      Jack74044 wrote:

      STemWin version 5.44+ is the latest version available for ST platforms.
      Is it too old?
      Could I update it?
      No it's not that old. The current version 5.48, so there were just to releases in between.
      It is up to ST to update the library.

      The only way for you to update to the latest version is to purchase a source code upgrade:
      segger.com/products/user-inter…win/emwin-source-upgrade/


      Regards,
      Sven
      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.
    • Sven wrote:
      Where does it get clipped? Do you draw it into a window or a memory device? If yes, enlarge the window or device. Of course you could also reduce the radius of the circle by the pen size.

      Jack74044:
      I'm not drawing the circle in a window, all shapes can be drawn using the entire LCD screen, the circle is just a small part on it, and get clipped as in the picture in the first post.
      If I reduce the radius by half the pen size, or even half the radius, the problem still exists, so it is definitely a bug in the circle drawing routine.
      It is nice we can use the ARC instead, and there is actually an AA version of that one too. Though is is my guess that the arc rendering may be slower than the circle rendering.

      Sven wrote:
      Yes, this is the expected behavior. Unfortunately, it is not possible to set a pen size for these shapes.

      Jack74044:
      emWin probably is a work in progress, may this be implemented in the future?

      Sven wrote:
      The only way for you to update to the latest version is to purchase a source code upgrade:

      Jack74044:
      I would wait for some improvements, like solving the circle clipping issue and a more consistent implementation of the pen size (for all basic shapes)...

      I will test a bit more, it may be interesting for my professional work, in the near future.

      The post was edited 3 times, last by Jack74044 ().

    • Hi,


      Jack74044 wrote:

      Where does it get clipped? Do you draw it into a window or a memory device? If yes, enlarge the window or device. Of course you could also reduce the radius of the circle by the pen size.
      There was a bug, we have fixed it with version 5.48a of emWin. Didn't remebered it...

      Jack74044 wrote:

      emWin probably is a work in progress, may this be implemented in the future?
      We always add new stuff or improve things. Yes, maybe we will add this is the future.

      EDIT:
      Under the following link you will find a project for Embedded Studio and the STM32F746 Discovery. It includes emWin V5.48o, you might want to give it a try. Beside of emWin it also includes a wide range of other middleware components like embOS, emUSB, emFile, etc..
      segger.com/downloads/eval/Segg…ry_CortexM_EmbeddedStudio

      To build and run the project you need two other things.
      Embedded Studio:
      segger.com/products/development-tools/embedded-studio/

      ST-Link Reflash utility which converts the ST-Link into a J-Link OB (don't worry you can restore the ST-Link):
      segger.com/downloads/jlink/STLinkReflash


      Regards,
      Sven
      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.