. NET3.5 GDI + graphics operation 3

Source: Internet
Author: User

10.2.4 Brush

Brush is commonly referred to as an internal object that defines the fill of graphic shapes such as rectangles, ellipses, pies, polygons, and closed paths. Brush is an abstract base class and cannot be instantiated. To create a Brush object, you use a class derived from brush, such as SolidBrush, TextureBrush, and LinearGradientBrush.

The SolidBrush class is used to define a monochrome brush. Brushes are used to populate graphic shapes, such as rectangles, ellipses, slices, polygons, and closed paths. The following table lists the commonly used methods and properties.

System.Drawing.Brushes defines a number of standard brushes that users can define directly with a blue brush.

System.Drawing.Brush brush = System.Drawing.Brushes.Blue;

Of course, users can also customize brushes.

// 定义一个红色笔刷
System.Drawing.Brush brush = new System.Drawing.SolidBrush (System.Drawing.Color.Red);

TextureBrush

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.