如何在字符串路径上设置背景?
canvas1.Background = "/path/";
请帮忙!!!谢谢:)
请您参考如下方法:
我认为您正在寻找 ImageBrush类:
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = new BitmapImage(new Uri(@"/path/", UriKind.Relative));
canvas1.Background = imageBrush;
