相关疑难解决方法(0)

将System.Windows.Media.Brush转换为System.Drawing.Brush

如何将System.Windows.Media.Brush转换为System.Drawing.Brush?

我正在尝试将system.windows.media.brush的颜色格式化为System.Drawing.Color对象.

下面的解决方案不起作用,因为它需要solidcolorbrush对象,而我需要转换的对象是system.windows.media.brush对象:

public System.Drawing.Color GetColor( System.Windows.Media.SolidColorBrush oBrush )
{
   return System.Drawing.Color.FromArgb( oBrush.Color.A,
                                     oBrush.Color.R,
                                     oBrush.Color.G,
                                     oBrush.Color.B );
}
Run Code Online (Sandbox Code Playgroud)

c# brush

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

brush ×1

c# ×1