【发布时间】:2014-04-02 15:55:50
【问题描述】:
我想通过后面的代码把网格背景转成图片,怎么做-
我试过这个-
ImageBrush gridBackground = (ImageBrush)(((Grid)sender).Background);
System.Windows.Controls.Image gridBackImage = new System.Windows.Controls.Image();
gridBackImage.Source = gridBackground.ImageSource;
报错-
无法将“System.Windows.Media.SolidColorBrush”类型的对象转换为“System.Windows.Media.ImageBrush”类型。
【问题讨论】:
-
你想用图片的
gridBackImage做什么?为什么不使用图像刷? -
请告诉我如何处理我用代码发布的上述异常?