16进制位颜色转换为brush返回类型的brushes.xxxx格式的颜色类库

h49023 25 0 DLL 2019-06-21 18:06:34

在网上搜了很久都没有可以直接将16进制的颜色转换为brush返回类型的brushes.xxx格式,于是我自己写了个转换的类库,里面有个colorConvert()方法可以转换,直接传16进制的字符串参数进去就可以进行转换了,比如:colorConvert("#FFFFFF");即将白色的16进制位转换为brushes.white

用户评论
请输入评论内容
评分:
Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

被坑了,下载好了才发现,我的代码这样改就行了。如下 g.DrawString("123",textFont,new SolidBrush(this.LineColor), new Rectangle(TextRectangle.X,TextRectangle.Y, TextRectangle.Width, RowHeight)); g.DrawString("123",textFont,Brushes.DarkRed, new Rectangle(TextRectangle.X,TextRectangle.Y, TextRectangle.Width

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

颜色倒是能转,但是不是我 输入的颜色,并且打包成dll,很不方便,不放心,最好是源码

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

有代码看看就好了!

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

尼玛!坑爹,这也叫转换类

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

.dll的不方便看代码

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

这也叫转换颜色类库啊?真是无语,用switch+case返回了那么二十几种Brushes,其余的HTML颜色全部用Brushes.Black代替了...骗分额

Generic placeholder image 卡了网匿名网友 2019-06-21 18:06:34

感谢分享,当我想要的是自定义颜色!