OK this should be an easy one. I've seen several other questions about that and it should work but inexplicably it doesn't. So I have that Image
<Image Name="LogoImage" Width="50" Height="50">
and I want to set it through code. So I have a s/r StrPath2ResizedBmpSize which resizes and gets a BitmapImage. That works because if in debug I take a look at the bmp it's ok.
Then I want to get the Image to set the LogoImage through this routine:
LogoImage = ImageUtilities.StrPath2ResizedImgSize(strFilename, 50, 50);
with
public static Image StrPath2ResizedImgSize(string strPath, int newWidth, int newHeight)
{
var bmp = new BitmapImage();
bmp = BitmapUtilities.StrPath2ResizedBmpSize(strPath, newWidth, newHeight);
Image img = new Image();
img.Source = bmp;<-----image is not set and it's null
return img;
}
but it doesn't work and the image is an image with null parameters. Where is the problem? Thank you
Imageobject ? Why not just set the source of theLogoImageone ? (which is already instanciated)