String、Brush、Color 相互转换
2024-08-25 10:14:47
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;
最新文章
- expect实现自动登录
- [原创]Centos7 从零编译配置Memcached
- VS高效开发快捷键
- sql里面的分页
- freeCodeCamp:Falsy Bouncer
- 【代码笔记】iOS-对iphone手机进行判断的一些函数
- Todd's Matlab讲义第4讲:控制误差和条件语句
- RabbitMQ入门教程(转)
- iOS ASIHTTPRequest 请求https
- c# 隐藏 控制台应用程序
- 滚动轮播插件——jCarouselLite
- Struts.properties(转)
- UVALive 4959 Jumping monkey
- Oracle:ORA-01791: 不是 SELECTed 表达式
- JAVA上连接ubuntu14.04上的Hbase
- 第十三节,基本数据类型,数字int字符串str
- Android百度地图开发-第一篇:申请、搭建百度地图
- 量化投资与Python之pandas
- HTTP入门
- echarts中地图提示";TypeError:i is undefined";
热门文章
- 【转】jsp页面中jstl标签详解
- NetBeans IDE 7.4 Beta版本build JavaFX时生成的可执行jar包执行时找不到依赖的jar包
- Spring中的BeanUtils与apache commons中的BeanUtils用法[1]
- 使用timer8秒读取一次方法进行操作
- “IPSec 共享密钥”丢失。
- centOS安装openoffice
- ios实用wifi分析仪——AirPort
- 找回windows 8 中隐藏的Aero Lite主题
- 更改SQL数据库的繁体数据为简体
- Linux Kconfig及Makefile学习