如何将 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 );
}