First, the preface
This article mainly describes how C + + draws the fillet of a moment line, which involves how to use a bit operation to handle the combination technique. The essence of GDI + is that it replaces the developer's ability to interact with the monitor and other external devices. For control beautification, need to achieve their desired effect, GDI + is essential. The rounded effect drawing is as follows:
Two, round angle enumeration and corresponding combination processing design
For the moment line, rounded corners are divided into upper left corner, upper right corner, lower left corner and lower right corner. The combination is divided into rounded corners, rounded corners, two rounded corners, three rounded corners, and four rounded corners. Enumerations need to satisfy the composition, there is no need to list all the combinations in the enumeration, and it is only through bitwise operations that you can calculate which combination belongs to. The enumeration classes are designed as follows:
[Flags]
Public enum Roundstyle
{
None = 0,
topleft = 1,
topright = 2,
bottomleft = 4,
bottomright = 8,
all = TopLeft | TopRight | Bottomleft | BottomRight
}