Menu

Drawing filled and empty circle

2021-12-23
2021-12-23
  • Herbert M Sauro

    Herbert M Sauro - 2021-12-23

    I just want to check that I am doing this right as I am still geting used to Image32. I want to draw a filled circle with an outline stroke or an empty circle with an outline stroke.

    I assume to draw an empty circle with an outline I would use code such as:

                     path := Circle(pt, 5);
                     DrawLine (img, path, 2, OutlineColor, esRound);
    

    And to draw a filled circle with an outline I would use code such as:

                     path := Circle(pt, 5);
                     DrawPolygon (img, path, frNonZero, FillColor);
                     DrawLine(img, path, 2, OutlineColor, esRound);
    

    Is that the way to do?

     
  • Angus Johnson

    Angus Johnson - 2021-12-23

    I assume to draw an empty circle with an outline I would use code such as:

                path := Circle(pt, 5);
                 DrawLine (img, path, 2, OutlineColor, esRound);
    

    Almost right.

                 path := Circle(pt, 5);
                 DrawLine (img, path, 2, OutlineColor, esPolygon);
    

    Same with your fill + outline.

    Edit:
    In the next packaged release (and already in the code repository) you could use esClosed instead of esPolygon.

     

    Last edit: Angus Johnson 2021-12-23