C # different types of paint brushes!

Source: Internet
Author: User

A paint brush is an object that can be used together with a graphics object to create a solid shape and render text.

1. The simplest form of solidbrush is to draw with solid color.

2. hatchbrush is similar to (1), but it can select a large number of Preset patterns instead of solid colors. (Namespace using system. Drawing. drawing2d ;)

3. Use texturebrush to draw images

4. lineargradientbrush is drawn using two colors mixed with lead linear gradient.

5. pathgradientbrush is based on the unique path defined by the developer and is drawn using a complex mixed color gradient.

 

private void button#click (Object sender, eventargs e)
{< br> // hatchbrush ahatchbrush = new hatchbrush (hatchstyle. plaid, color. red, color. blue);
// texturebrush mybrush = new texturebrush (New Bitmap (@ "C:/users/wu_kobe/pictures/1.jpg "));
graphics G = creategraphics ();
// solidbrush mybrush = new solidbrush (color. red);

lineargradientbrush mybrush = new lineargradientbrush (clientrectangle,
color. red, color. yellow, lineargradientmode. backwarddiagonal);
G. fillellipse (mybrush, clientrectangle);
}

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.