C # GDI + How to draw rounded corners of a moment line

Source: Internet
Author: User

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
    }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.