// (实心刷)
Rectangle rect1 = new Rectangle(, , , );
SolidBrush sbrush1 = new SolidBrush(Color.DarkOrchid);
SolidBrush sbrush2 = new SolidBrush(Color.Aquamarine);
SolidBrush sbrush3 = new SolidBrush(Color.DarkOrange);
//(梯度刷)
LinearGradientBrush lbrush1 = new LinearGradientBrush(rect1,
Color.DarkOrange, Color.Aquamarine,
LinearGradientMode.BackwardDiagonal); //(阴影刷)
HatchBrush hbrush1 = new HatchBrush(HatchStyle.DiagonalCross,
Color.DarkOrange, Color.Aquamarine);
HatchBrush hbrush2 = new HatchBrush(HatchStyle.DarkVertical,
Color.DarkOrange, Color.Aquamarine);
HatchBrush hbrush3 = new HatchBrush(HatchStyle.LargeConfetti,
Color.DarkOrange, Color.Aquamarine); //(纹理刷)
textureBrush = new TextureBrush(new Bitmap(@"e:\123.jpg"));
//e.Graphics.FillRectangle(hbrush1, rect1);
//e.Graphics.FillRectangle(sbrush1, rect1);
//e.Graphics.FillRectangle(textureBrush, rect1);
e.Graphics.FillRectangle(lbrush1, rect1);
using System.Windows.Media;

、String转换成Color

            Color color = (Color)ColorConverter.ConvertFromString(string);

、String转换成Brush

            BrushConverter brushConverter = new BrushConverter();
Brush brush = (Brush)brushConverter.ConvertFromString(string); 、Color转换成Brush Brush brush = new SolidColorBrush(color)); 、Brush转换成Color有两种方法: ()先将Brush转成string,再转成Color。 Color color= (Color)ColorConverter.ConvertFromString(brush.ToString()); ()将Brush转成SolidColorBrush,再取Color。 Color color= ((SolidColorBrush)CadColor.Background).Color;
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script src="../../../JS/jquerycj/jquery-1.7.2.min.js" type="text/javascript"></script>
<style> </style>
<script>
var s;
var studata = [
{ id: 1, name: '张三', selected: true },
{ id: 2, name: '深蓝色', selected: true },
{ id: 3, name: '肖西林', selected: true },
{ id: 4, name: '田伟', selected: true },
{ id: 5, name: '李四', selected: true },
{ id: 6, name: '彭平', selected: false },
{ id: 7, name: '张三丰', selected: false },
{ id: 8, name: '肖西林', selected: false },
{ id: 9, name: '肖西林', selected: false },
{ id: 32, name: '肖西林', selected: false },
{ id: 22, name: '肖西林', selected: false },
{ id: 65, name: '肖西林', selected: false },
];
$(function() {
s = new SelectStu('select_stubox',studata);
});
//取值
function tt() {
alert(s.val());
}
</script>
<link href="http://localhost:12580/SOA/common/SelectStu/selectStu.css" rel="stylesheet" type="text/css" />
<script src="http://localhost:12580/SOA/common/SelectStu/selectStu.js" type="text/javascript"></script>
</head>
<body> <form id="form1" runat="server"> <div id = "select_stubox" style="width:600px;">
</div>
<input type="button" value="tt" onclick="tt();" />
</form>
</body>
</html>

【转】C# 的Brush 及相关颜色的操作的更多相关文章

  1. C# 的Brush 及相关颜色的操作 (并不是全转)

    C# 的Brush 及相关颜色的操作 2013-12-13 14:08             4977人阅读             评论(0)             收藏             ...

  2. Ribbon Workbench 与此流程相关的流程操作未激活

    问题描述:使用Ribbon Workbench 打开解决方案时报 :与此流程相关的流程操作未激活 解决方法 :ribbon 导航--系统定置--流程中心--流程--CustomiseRibbon -- ...

  3. 阿里云ECS服务器相关配置以及操作---上(初学者)

    最近买了一台阿里云的ECS服务器 linux系统 centos镜像,把我相关的一些操作记录下来,供大家参考,不足之处欢迎指正. 首先买的过程就不用介绍了,根据自己的实际需要选择自己想要的配置,点击付钱 ...

  4. 设置RichEdit相关颜色说明

    1.设置RichEdit客户区的背景颜色 要设置RichEdit的背景色,需要发送 EM_SETBKGNDCOLOR 消息给RichEdit控件,关于该消息的说明:wParam参数 为颜色选项,如果是 ...

  5. 改变滚动条的原始样式: chrome 可以改变, IE只能变相关颜色,firfox好像也不好改。最好是自己写一个或是用插件

    相关作者链接地址: https://www.lyblog.net/detail/314.html 问题: 1.我在项目中遇到的问题: 在设置了::-webkit-scrollbar 后,滚动条不见了! ...

  6. NavigationController相关颜色设置

    一.当push进去一个界面后,返回按钮颜色改变: self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

  7. python 日期相关的各种操作总结

    用 Python 做项目时,经常会遇到与日期转换相关,日期计算相关的功能,动不动就要去查python手册,感觉麻烦,因此把自己常用的一些东西,总结了一下,总体说来到目前为止遇到如下一些需求: 1. 用 ...

  8. python中跟字符串相关的一些操作

    公司让用python自动生成代码,以前没看过python.所以匆匆的看了两天python就连猜带蒙就上马开干了..因此好多操作可能看的时候看懂了,用的时候知道有这么个东西,具体用法就忘记了..用到了就 ...

  9. JQuery 相关用法和操作

    01-JQuery 基础语法: 1.使用JQuery必须先导入JQuery.x.x.xjs文件. 2.JQuery中的选择器: $(选择器).函数() ① $是JQuery的缩写,既可以使用JQuer ...

随机推荐

  1. 导航菜单跳转后,新页面上菜单CSS选定

    <div class="menu"> <ul> <li><a href="#" title="网站首页&qu ...

  2. Windows中断那些事儿

    搞内核研究的经常对中断这个概念肯定不陌生,经常我们会接触很多与中断相关的术语,按照软件和硬件进行分类: 硬件CPU相关: IRQ.IDT.cli&sti 软件操作系统相关: APC.DPC.I ...

  3. 基于XML配置的spring aop增强配置和使用

    在我的另一篇文章中(http://www.cnblogs.com/anivia/p/5687346.html),通过一个例子介绍了基于注解配置spring增强的方式,那么这篇文章,只是简单的说明,如何 ...

  4. Mysql远程访问

    命令行: mysql -h 192.168.1.145 -u root -p 1.初始化root密码 进入mysql数据库 1mysql>update user set password=PAS ...

  5. (转)win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

    原文地址:http://www.cnblogs.com/fnng/p/4115607.html 作者:虫师 今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-pyth ...

  6. JavaScript摇股子

    摇股子就是用javascript实现的一个简单的小特效. 下面来看一下我自己做的一个用javascript实现的摇股子. 效果图如下: 我做的股子是由6张图片,点击股子它自己会随机晃动. 代码如下: ...

  7. SectionIndexer示例

    This small tutorial will show you how to create a ListView, enable fast scrolling, and create a alph ...

  8. mongodb的用户管理及安全认证

    1.确认mongodb的版本 > use admin switched to db admin > db.runCommand({}) { "version" : &q ...

  9. 解决WARN: Timeout/setRollbackOnly of ACTIVE coordinator !的问题

    该问题是CoordinatorImp上面的一个定时器造成的,一个活动的session如果在一定的时间内没有执行完毕就会rollback,就算没有sql执行也会不断的进行. 可以参考该链接:https: ...

  10. 我的emacs配置

    我的emacs配置文件 ;; .emacs ;; ============================== Basic Configure START ====================== ...