How to create Source for WPF Media Element from byte array using c#?

∥☆過路亽.° 提交于 2019-12-11 02:36:44

问题


I have converted a video to bytes array and stored it in MsSql Database. Now I fetch it from database and I get the byte array. I want to set this byte array as Source of media element and then show this video in WPF application.

Please suggest a way where I can convert byte array or memory stream to Media Elements Source?

I will not have permission to write on users machine, so writing a file onto user machine and then setting the source will not work for me.


回答1:


That's not directly possible. Only the MediaElement from Silverlight supports that feature. There are some workarounds. Checkout this link.



来源:https://stackoverflow.com/questions/14181405/how-to-create-source-for-wpf-media-element-from-byte-array-using-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!