Winrt, Javascript, Image From Byte Array
I have a C++/CX component that can return an image as a stream (I could easily make it return an IBuffer, if that makes things easier). Currently, the component's return type is IR
Solution 1:
I've done this in C# before not in C++, but the basics should be similar.
- Get the byte array from the stream
- Convert the byte array to Base64String (Convert.ToBase64String)
- Now you can use this string directly in the image tag:
<img src="data:image/png;base64,YOUR_STRING" />
Post a Comment for "Winrt, Javascript, Image From Byte Array"