![](/img/trans.png)
[英]Convert System.Windows.Media.Brush to System.Drawing.Brush
[英]System.Drawing.Brush from System.Drawing.Color
我正在为我们公司开发WinForm Printing应用程序。
打印文档时,我需要获取文档上每个Control的System.Drawing.Color
属性,并创建一个System.Drawing.Brush
对象来绘制它。
有没有办法将System.Drawing.Color
值转换为System.Drawing.Brush
值?
注意:我已经尝试查看System.Windows.Media.SolidColorBrush()
方法,但它似乎没有帮助。
使用SolidBrush类:
using (SolidBrush brush = new SolidBrush(yourColor)) {
// ...
}
为什么不用GDI +刷?
http://msdn.microsoft.com/en-us/library/system.drawing.solidbrush.solidbrush.aspx
另一个是WPF。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.