I've got some issue. I'm trying to load png-image from resources to BitmapImage propery in my viewModel like this:
Bitmap bmp = Resource1.ResourceManager.GetObject(String.Format("_{0}",i)) as Bitmap;
MemoryStream ms = new MemoryStream();
bmp.Save(ms, ImageFormat.Bmp);
BitmapImage bImg = new BitmapImage();
bImg.BeginInit();
bImg.StreamSource = new MemoryStream(ms.ToArray());
bImg.EndInit();
this.Image = bImg;
But when I do it, I lose the transparency of the image. So the question is how can I load png image from resources without loss of transparency? Thanks, Pavel.