Windows Phone 8: How to set Image on the fly - windows-phone-8

Windows Phone 8 :
I have an HTML design to bind in webbrowser control.
In that HTML I need to set the image() dynamically from my windows 8 phone application itself (Eg:MyApp/Images/Done.png).
How to set this Image in my HTML dynamically?
Could any one help me on that?

In terms of Zen, WP8 tried to align Uris as close as possible to Win8 Uris. So whenever you ask yourself "How do WP8 Uris work?" a good starting point would be Win8 and WP7 behaved. For example, you'll see lots of "ms-appx:///" and "ms-appdata:///" all around WP8.
Specfically, In order to access an app's Image resources from a WebBrowser just specify the local file path.For example, start a new WP8 project and in MainPage.xaml add:
<phone:WebBrowser Source="myPage.html" />
And create myPage.html and add:
<html>
<body>
<img src="Assets/AlignmentGrid.png"/>
</body>
</html>
This would render the correct image as part of the WebBrowser. See attached .

Related

Is there a way for a Windows tablet— when uploading an image on a website— to prompt to use the camera instead of using the File Explorer?

Problem
I'm currently working on a web application that needs to be able to upload images a lot. It is an <input type="file" name="picture" accept="image/*"> tag. Just like most other tablet or phone, I assumed that users on a Windows tablet— A Dell Venue 10 pro 5055, running on Windows 10 Enterprise in this case— would also be prompted to use the on-device camera or to choose from files. This is unfortunately not the case and makes the application a lot less user-friendly.
Tries
I checked this post: Can you launch the native Camera App from an Html 5 Web App?, the answer stated that using the following tag solved the problem for Android: <input type="file" accept="image/*;capture=camera">. This did not work for Windows.
The following post did provide an answer but that answer only works on Windows 8.1 unfortunately: Capturing images in web application on Windows 8.1 tablets
So is there a way to configure the tablet or to change the <input> tag in such a way that the user will be prompted to take a picture instead of choosing from an existing file?
Thank you in advance!

How to open a local html file in Windows 8.1 mobile app

We are building a Windows 8.1 mobile app. We are trying to open a local html file in the browser programmatically but do not know how to achieve this functionality. Please let us know how we can implement the same.
Thanks.
You can display web content using the WebBrowser control for Windows Phone 8
this Link may use for You
WebBrowser control for WP

Silverlight web application loading an external page in the app

Basically i have an application that needs to be able to navigate to a webpage on the app whilst in the browser in silverlight how can i go about doing this?
It does not let me use the web browser tool and i cannot find any other way. I dont think i will be able to use an iframe either as i need to be able to draw a canvas over the webpage that can then be drawn upon using a paint tool and i dont think using an iframe will allow this.
So how do i go about getting an external website to load inside of my web silverlight application?
You're right, there is a WebBrowser control but it is only available when running in out of browser mode.
I'm afraid at the moment, the only way is by using an Iframe (spent many hours searching).
I managed to get it working OK by using this tutorial: Showing HTML content inside silverlight app
However for your requirements (drawing on top of the webpage) this will not work, as it does not allow the Silverlight app to integrate with the html content.
The only option that i can think of is setting your app be be out of browser, then using the WebBrowser control
But this will not be appropriate as i've just noticed that your app needs to be accessible through a browser!

Open url in system browser windows phon

I am making an html5 app for windows phone 8 and I have a link that is generated by JavaScript and passed into a frame. I would like to put an open in browser button on the application bar. With ios you can do this by adding the _system to the link is there an equivalent in WP? Is there any way to open the browser without using the launcher or is there a way to get the JavaScript variable into the launcher?
You can use Launchers to open and system application
Below is the sample code for the same:
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://msdn.microsoft.com", UriKind.Absolute);
webBrowserTask.Show();
MSDN Reference:
How to use the web browser task for Windows Phone

prevent showing app screenshot in application navigation in WP8

for a security critial app I need to prevent the phone making screenshots of the embedded browser control.
On Windows Phone, if you hold the back button pressed, the opened applications are shown with small preview images.
Is there any way to replace that image being used there by an own image. Or is it possible to exclude controls using a xaml syntax from beeing captured?
Thanks Holger
Windows Phone 8 GDR 3 introduced a hidden property on the page object that you can use to prevent screenshots from being taken of that page. Here is more detail