Reputation: 89
this.Background =
new ImageBrush(new BitmapImage(
new Uri(@"pack://application:,,,/Stream;component/images/empty.png")));
Doesn't work! I get an IOException, that says Cannot locate resource, My project's name is stream, even my assembly name and default name space...please help...
or if there's an alternative like converting the Bitmap Image to ImageSource please tell me..
Upvotes: 0
Views: 633
Reputation: 22739
Check the Build Action on empty.png
(right click the file in Solution Explorer and select Properties). It should be Resource
(not Embedded Resource
).
Upvotes: 3