lundi 20 avril 2015

How to use image in WPF as resource?

I was googling, but I have not found what I need. I tried to use this code to use image resource(build action setted):

BitmapImage bi3 = new BitmapImage();
        bi3.BeginInit();
        bi3.UriSource = new Uri(@"Resources\wall.png", UriKind.RelativeOrAbsolute);
        bi3.EndInit();

it throws filenotfoundexception

Aucun commentaire:

Enregistrer un commentaire