add image programmatically
my images are not showing up when adding them as followed:
am i missing something completely? the path is correct !
1 Reply
try
{
Image image = new Image();
BitmapImage bitmap = new BitmapImage(new Uri(imagePath, UriKind.Relative));
image.Source = bitmap;
overlayWindow.Children.Add(image);
}
catch (Exception ex)
{
Console.WriteLine("Error loading image: " + ex.Message);
}