C # usage of Brush

Source: Internet
Author: User

C # usage of Brush

From: http://m.cnblogs.com/66756/1675787.html? Full = 1

 

private void form1_paint (Object sender, painteventargs e)
{< br> // (solid brush)
rectangle myrect1 = new rectangle (20, 80,250,100 );
solidbrush mysbrush1 = new solidbrush (color. darkorchid);
solidbrush mysbrush2 = new solidbrush (color. aquamarine);
solidbrush mysbrush3 = new solidbrush (color. darkorange);

// (Gradient brush)
Lineargradientbrush mylbrush5 = new lineargradientbrush (rect1,
Color. darkorange, color. Aquamarine,
Lineargradientmode. backwarddiagonal );

// (Shadow brush)
Hatchbrush myhbrush5 = new hatchbrush (hatchstyle. diagonalcross,
Color. darkorange, color. Aquamarine );
Hatchbrush myhbrush2 = new hatchbrush (hatchstyle. darkvertical,
Color. darkorange, color. Aquamarine );
Hatchbrush myhbrush3 = new hatchbrush (hatchstyle. largeconfetti,
Color. darkorange, color. Aquamarine );

// (texture brush)
texturebrush = new texturebrush (New Bitmap (@ "E: \ 123.jpg");
E. graphics. fillrectangle (mysbrush1, rect1); // (solid fl)
E. graphics. fillrectangle (mylbrush1, rect1); // (gradient brush)

E. Graphics. fillrectangle (myhbrush1, rect1); // (shadow brush)
E. Graphics. fillrectangle (mytexturebrush, rect1); // (texture brush)

}

The namespace of the lineargradientbrush class is system. Drawing. drawing2d.

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.