1、String转换成Color

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

2、String转换成Brush

BrushConverter brushConverter = new BrushConverter();
            Brush brush = (Brush)brushConverter.ConvertFromString(string);

3、Color转换成Brush

Brush brush = new SolidColorBrush(color));

4、Brush转换成Color有两种方法:

(1)先将Brush转成string,再转成Color。

Color color= (Color)ColorConverter.ConvertFromString(brush.ToString());

(2)将Brush转成SolidColorBrush,再取Color。

Color color= ((SolidColorBrush)CadColor.Background).Color;

最新文章

  1. expect实现自动登录
  2. [原创]Centos7 从零编译配置Memcached
  3. VS高效开发快捷键
  4. sql里面的分页
  5. freeCodeCamp:Falsy Bouncer
  6. 【代码笔记】iOS-对iphone手机进行判断的一些函数
  7. Todd's Matlab讲义第4讲:控制误差和条件语句
  8. RabbitMQ入门教程(转)
  9. iOS ASIHTTPRequest 请求https
  10. c# 隐藏 控制台应用程序
  11. 滚动轮播插件——jCarouselLite
  12. Struts.properties(转)
  13. UVALive 4959 Jumping monkey
  14. Oracle:ORA-01791: 不是 SELECTed 表达式
  15. JAVA上连接ubuntu14.04上的Hbase
  16. 第十三节,基本数据类型,数字int字符串str
  17. Android百度地图开发-第一篇:申请、搭建百度地图
  18. 量化投资与Python之pandas
  19. HTTP入门
  20. echarts中地图提示"TypeError:i is undefined"

热门文章

  1. 【转】jsp页面中jstl标签详解
  2. NetBeans IDE 7.4 Beta版本build JavaFX时生成的可执行jar包执行时找不到依赖的jar包
  3. Spring中的BeanUtils与apache commons中的BeanUtils用法[1]
  4. 使用timer8秒读取一次方法进行操作
  5. “IPSec 共享密钥”丢失。
  6. centOS安装openoffice
  7. ios实用wifi分析仪——AirPort
  8. 找回windows 8 中隐藏的Aero Lite主题
  9. 更改SQL数据库的繁体数据为简体
  10. Linux Kconfig及Makefile学习