My requirement to get image from images folder from my current stimulation explore.
we need access image from Images folder.
My code is gives an error at ImageSource MoleImage = new BitmapImage(new Uri(".Images/Section5Q4femail1.pngeMole")); line
private Image CreateImage()
{
Image Mole = new Image();
Mole.Width = 25;
Mole.Height = 25;
ImageSource MoleImage = new BitmapImage(new Uri(".Images/Section5Q4femail1.pngeMole"));
Mole.Source = MoleImage;
return Mole;
}
Create Uri object like this
new Uri("/Earnest_Individuals;component/Images/Section5Q4femail1.pngeMole");
where Earnest_Individuals is your project assembly name.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.