Home>
Question

I thought of making my own circular progress bar with C language WinAPI.
It may be a simple render, but since it came out when I found out that GDI was slow, it was an image buffer? I wanted to display pies and circles with StretchDIBits using dib, but is there any function or method to render them in dib image buffer with anti-aliasing?

Supplemental information (FW/tool version etc.)

VisualStudio 2017 Community
Windows10 Pro

  • Answer # 1

    I can suggest the following two ideas.

    Get anti-aliasing effect with SetStretchBltMode

    It is a technique that has been known for a long time, but draws lines and circles with GDI several times the bitmap of the transfer destination, specifies HALFTONE with SetStretchBltMode, then draws to the transfer destination with StretchBlt or StretchDIBits Then you can get an anti-aliasing effect. This has the same effect as anti-aliasing because the destination color is also used for compositing. The greater the magnification difference between the transfer destination and the transfer source, the stronger the anti-aliasing effect. However, since the blur is strong, it feels like adjusting the transfer magnification according to what you want to make (feeling adjusting the size of the source bitmap).

    Use GDI + obediently

    C ++, but with GDI + it is possible to draw anti-aliased lines and circles in dib.