The code below works in another project. Also in the second one if I include absolute url.
I have the res folder in my project folder. What can be different?
BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(@"\res\arato.png", UriKind.RelativeOrAbsolute);
myBitmapImage.EndInit();
var img = new Image();
img.Source = myBitmapImage;
img.Margin = new Thickness(0, 0, 0, 0);
canvas.Children.Add(img);
Use Pack URIs to give the relative or absolute path.