"Turn" C # 's brush and related colors operations

Source: Internet
Author: User

//(solid brush)Rectangle Rect1 =NewRectangle ( -, the, -, -); SolidBrush Sbrush1=NewSolidBrush (Color.darkorchid); SolidBrush Sbrush2=NewSolidBrush (Color.aquamarine); SolidBrush Sbrush3=NewSolidBrush (color.darkorange);//(gradient brush)LinearGradientBrush LBRUSH1 =NewLinearGradientBrush (Rect1,color.darkorange, color.aquamarine,lineargradientmode.backwarddiagonal);//(shadow Brush)HatchBrush HBRUSH1 =NewHatchBrush (Hatchstyle.diagonalcross,color.darkorange, color.aquamarine); HatchBrush Hbrush2=NewHatchBrush (Hatchstyle.darkvertical,color.darkorange, color.aquamarine); HatchBrush Hbrush3=NewHatchBrush (Hatchstyle.largeconfetti,color.darkorange, color.aquamarine);//(texture brush)TextureBrush =NewTextureBrush (NewBitmap (@"e:\123.jpg"));//E.graphics.fillrectangle (HBRUSH1, rect1);//E.graphics.fillrectangle (SBRUSH1, rect1);//E.graphics.fillrectangle (TextureBrush, rect1);E.graphics.fillrectangle (LBRUSH1, rect1);

usingSystem.Windows.Media;1, string is converted to a color color color= (Color) colorconverter.convertfromstring (string);2, string converted to brush Brushconverter brushconverter=NewBrushconverter (); Brush Brush= (Brush) brushconverter.convertfromstring (string);3, color into a brush brush brush=NewSolidColorBrush (color));4, the brush is converted to color in two ways: (1first, turn the brush into a string and turn it into color. Color Color=(Color) colorconverter.convertfromstring (brush). ToString ()); (2) Turn the brush into SolidColorBrush and then color. Color Color= ((SolidColorBrush) cadcolor.background). Color;

<HTMLxmlns= "http://www.w3.org/1999/xhtml"><HeadID= "Head1"runat= "Server">    <title></title>    <Scriptsrc=".. /.. /.. /js/jquerycj/jquery-1.7.2.min.js "type= "Text/javascript"></Script>    <style>            </style>    <Script>var s;            var studata = [{id:1, Name: ' Zhang San ', selected:true}, {id:2, Name: ' Dark blue ', selected:true}, {id:3, Name: ' Xiao Xilin ', selected:true}, {id:4, name: ' Tian Wei ', selected:true}, {id:5, Name: ' John Doe ', selected:true}, {id:6, Name: ' Cedog ', selected:false}, {id:7, name: ' Zhang Sanfeng ', selected:fals e}, {id:8, Name: ' Amoxicillin ', selected:false}, {id:9, Name: ' Xiao Xilin ', selected:false}, { ID:32, Name: ' Xiao Xilin ', selected:false}, {id:22, Name: ' Xiao Xilin ', selected:false}, {id:65, name: ' Shaw            Xilin ', selected:false},];             $ (function () {s = new Selectstu (' Select_stubox ', studata);            });            Value function tt () {alert (S.val ()); }    </Script>    <Linkhref= "Http://localhost:12580/SOA/common/SelectStu/selectStu.css"rel= "stylesheet"type= "Text/css" />    <Scriptsrc= "Http://localhost:12580/SOA/common/SelectStu/selectStu.js"type= "Text/javascript"></Script></Head><Body>    <formID= "Form1"runat= "Server">       <DivID= "Select_stubox"style= "width:600px;">    </Div>    <inputtype= "button"value= "tt"onclick= "tt ();" />    </form></Body></HTML>

"Turn" C # 's brush and related colors operations

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.