Hi there, I obtain an array of byte (byte[]) from db and render into a Image Control using the following method :
public Image BinaryImageFromByteConverter(byte[] valueImage)
{
Image img = new Image();
byte[] bytes = valueImage as byte[];
MemoryStream stream = new MemoryStream(bytes);
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = stream;
image.EndInit();
img.Source = image;
img.Height = 240;
img.Width = 240;
return img;
}
So now that is rendered, I want to "copy" the Image.Source from Image (Control) to another element, for example : Paragraph..
paragraph1.Inlines.Add(new InlineUIContainer(ImageOne));
but nothings appears, I try to create a new Image using ImageOne.Source but I just found this example with Uri(@"path"), I cant apply this method cause my BitmapImage comes from a byte[] type
Image img = new Image();
img.Source = new BitmapImage(new Uri(@"c:\icons\A.png"));
Helps with this issue please, thanks!