Have MediaElement in my application used to preview media file such as music, video, image.. MediaElement only allow set source is a URi(contain file path). I have image storaged by Byte array and now I want preview it on MediaElement. how to I convert from byte array to uri to preview mediafile ? If have any other solution to preview mediafie, Please list it. Thank.!
Asked
Active
Viewed 7,523 times
1
-
is it a path in bytes or image itself? – Ovais Khatri Jun 24 '11 at 09:29
2 Answers
1
if it is path...then you can use System.Text.Encoding.UTF8.GetString(byteArray[])
and then assign that path to media element to preview image...
If it is image, you have to convert back that image from byte and then assign it ti Image element...to preview. Check this link: http://www.codeproject.com/KB/recipes/ImageConverter.aspx

Ovais Khatri
- 3,201
- 16
- 14
-
Thank for reply. But i want general preview not only image. And I only want display on MediaElement control. – Tuan Bach Van Jun 24 '11 at 09:55