Robert Oschler
Robert Oschler

Reputation: 14375

Embed Image data taken from a Windows Phone 7 camera app, directly into a web page?

I have a Windows phone app that takes images from the phone's camera. I now want to take that image obtained from the camera via C# code and build a web page dynamically that will show the user the camera snapshot in the web page. I want to avoid the overhead of uploading the image to a server just so the dynamically created web page can load the image from an accessible URL. Is there any way to directly embed the binary image data in a web page?

If not, is there some trick I can use from C# to store the image data in something that looks like a URI, that will be accessible from the web page? (i.e. - something that I can set the IMG element's SRC property to)? I'm guessing that the phone's web browser control will not allow access to files saved to isolated storage without bothering the user to load the image via an Open File dialog, something I want to avoid.

NOTE: I don't want to use Windows Phone controls to display the image instead of a web page because I have a large Javascript library that I need to run against the image. That's why I want to get the image into a web page.

Upvotes: 0

Views: 163

Answers (1)

user2757572
user2757572

Reputation: 463

Does this help?: http://en.wikipedia.org/wiki/Data_URI_scheme

http://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html states that: "The down-side is that the image is base64 encoded, so it is much larger than it’s binary sibling. This makes the use of this rather limited."

Upvotes: 1

Related Questions