String、Brush、Color 相互转换
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;
转载于:https://www.cnblogs.com/XzcBlog/p/3816789.html
String、Brush、Color 相互转换相关推荐
- String与InputStream相互转换
1.String to InputStream String str = "String与InputStream相互转换"; InputStream in_nocode = new ...
- String和List相互转换
1.String和List相互转换 public static void main(String[] args) {List<String> list=new ArrayList();li ...
- teeChart控件的异常:MARKS.CALLOUT.BRUSH.COLOR:Property callout does not exist
环境: cb6.0 +windows xp 最近,程序中所有含有 TeeChart控件的窗口,突然之间打不开了, 连续提示3个错误: 1,...."Property callout does ...
- swift string,Int,Double相互转换
import UIKitvar str = "Hello, playground" // 1 字符串转Int Double Float var str1 = "818&q ...
- string和wstring相互转换
VS2015+QT环境,加载dll函数loadlibrary,使用宽字符参数.路径有汉字总加载失败,于是先将汉字转化再加载dll,成功. std::string ConvertUtf8ToGbk(co ...
- 时间工具类、Instant、date、LocalDate、String、LocalDateTime 相互转换
public final class TimeUtil {private static final Logger LOGGER = LoggerFactory.getLogger(TimeUtil.c ...
- String与Integer相互转换
一.Integer转String //方法一:Integer类的静态方法toString() Integer a = 2; String str = Integer.toString(a)//方法二: ...
- winform C#中Byte与String的转换方法,相互转换
字节数组转字符 byte2string byte[] JieGuo = 字节数组 string JieGuoZiFu = BitConverter.ToString(JieGu ...
- 2015.5.11 string与byte[]相互转换
string类型转成byte[]: byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); 反过来,byte[]转成stri ...
最新文章
- 使用树莓派搭建WordPress个人博客
- 转载: 快速理解Docker - 容器级虚拟化解决方案
- 前端导出文件,后端返回文件流过大直接干崩溃
- 阿里云最新虚拟化研发岗招聘
- 简单了解Java语言
- VOD紧急抱团是利是弊?
- 转载一篇JAVA面试题
- 手机卫星定位系统_手机一键“连接”北斗卫星导航?这一设置打开:立马连接,很简单...
- ACCV 结果出来了,大家来晒一晒吧~
- vue elementUI 默认事件 添加额外参数
- Android Compose 新闻App(二)ViewModel、Hlit、数据流
- Fisher information解释和数学意义
- 微信小程序仿朋友圈,实现点赞和评论功能
- 【名词】DAU和MAU
- 区块链改革杭州闭门会议——分享链改机遇,探讨价值联动!
- 便携式计算机的基本知识,使用便携式计算机,错误的做法是()A、非涉密便携机不得存储或处理涉密信息B、涉密便携机需经过保 - 普法考试题库问答...
- 用计算机写作文主题,用计算机写作文》——学习智能ABC输入法
- Win10 恢复后退键
- 全球及中国职业教育市场创新发展与投资决策建议报告2022版
- 百度云管家下载速度也作假
热门文章
- java接口如何定义常量 c_java接口定义常量研究
- linux wps 中文输入法_linux_从windows到ubuntu再到manjaro
- matlab 数据拟合
- FPGA之道(52)状态机的概念
- Javapinyin4J实现中文名转拼音
- 浅谈JS原型与原型链(一)
- python3写unicode编码到文件
- mysql解决Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp
- IOS TableView实现省市联动
- 【原创】单片系统SoC