Click here to Skip to main content
15,909,437 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to show image in wpf image box. that image is in byte format at database. how will i show that image. please help me out.
Posted

Make sure you give the full path to the image.
<image name="image4" stretch="None" source="C:\Users\smevis\Desktop\WpfApplication1\mn.png" isenabled="True" stretchdirection="Both" />
 
Share this answer
 
v2
finally i found the answer
C#
byte[] b;
                //b=memStream.GetBuffer();
        b = System.IO.File.ReadAllBytes(openfile.FileName);
        MemoryStream byteStream = new MemoryStream(b);
        BitmapImage image = new BitmapImage();
        image.BeginInit();
        image.StreamSource = byteStream;
        image.EndInit();

        image1.Source = image;
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900