In my application I want the user to load an image as the canvas background. How can I assign the image to canvas background?
Asked
Active
Viewed 2.2k times
1 Answers
15
Use ImageBrush to set Canvas.Background property
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(@"sampleImages\berries.jpg", UriKind.Relative));
mycanvas.Background = ib;

Colin D
- 5,641
- 1
- 23
- 35

Nikhil Agrawal
- 47,018
- 22
- 121
- 208