WP7: Accessing image data of WebBrowser control - windows-phone-7

I've got a WebBrowser on my phone UI (from Microsoft.Phone.Controls), showing web page with images. How do I access the html image binary data?
I want to store the image for later rendering, and perhaps do some image transformations for it too.

You cannot do that since WebBrowser control is pretty much sandboxed and you don't have access to DOM or anything inside it.
EDIT: You can at least get the HTML source for the page and you could then parse the source, extract urls for images and then manually download them. You can get the source via the WebBrowser.SaveToString method

Related

phone inappbrowser doesn't start from full-zoomed-out when it loads huge image

I have a window.open code to launch inappbrowser on phonegap. I use it for displaying image.
This inappbrowser has EnableViewPortScale=yes, so it's totally zoomable.
However, it seems like there is zoom-out-limit in inappbrowser. Here is the code.
window.open(myFullImageUrl, '_blank',
'location=no,EnableViewPortScale=yes,presentationstyle=pagesheet');
It's already zoomed-in a little. I can zoom-in-and-out because of EnableViewPortScale=yes for sure.
However, it seems like there is zoom-out-limit.
when i load up 1024x768 photo, it doesn't show fully zoomed-out photo(on both iOS and Android), but it's like 120%-ish already zoomed in.
I Just created stackoverflow account, so i can't upload photo. sorry!(it says i need 10 reputations to upload image)
There is no true solution for this issue.
So what I did is I just continue using inAppBrowser, but just instead of directly loading image from Amazon server(that's where I stored all images), I just made my window.open to go to another my URL and attach that url as a parameter after '?'.
The reason why I did this is because then I can force the Image web-view to have brief Javascript and CSS to render this dang-image correctly.
And as you guys know, this page must have meta-data that allows user-scale true, and must NOT have max-scale value.
So, Yep. Long story short, If you DIRECTLY load up the image in the inAppBrowser of phonegap, there is NO WAY you can force the image to start with 'not even slightly zoomed-in, but perfectly zoomed-out to the max'. Your own Page, Your own JS and CSS is the way to go guys.

How to handle downloads in mobile site

How does one handle image downloads in a mobi site - using jquery mobile and asp.net mvc 3 and have a requirement to allow a user to download wallpapers to their mobile.
Can you trigger a download or is best to simply simple the image to them and let them handle the saving?
Any input appreciated.
Typically, you can force the download of content on standard browsers by setting headers
"Content-Disposition", "attachment; filename=\"LicenseAgreement.pdf\""
on the return. This SO shows how to return a PDF file but theoretically, you could do the same with an image.
How can I present a file for download from an MVC controller?
However, it is questionable if every browser that is supported by jquery mobile would even respect that and give any kind of a save prompt or just open the image in a new window. Give it a shot but test it on iOS, Android, WinPhone 7.5+, and (gagging) Blackberry 6+ and see what happens because they're probably going to all behave a little differently.
Were it me, I'd simply link directly to the image either on the current page or with a target="_blank" and let them save it however they usually save images.

How to capature the image in a Table in MVC3 (Razor)

i have develop a MVC3 application in that i want capture the Image, that image i have set a table td baground. When i click the Button then i want capture that image .Is it possible in MVC3 ? If possible please help me .
td's are html. They are rendered by a browser, not the server.
Browsers do not have facilities to save the content they render as images. The server doesn't know anything about how it's rendered. It just sends text to the browser.
There is no way, short of an activex control of some sort (which won't work in FF, Chrome, Safari, Opera, etc..) to render the iamge people see.
You could render an image on the server side.. but it would not, necessarily, be identical to what the end users sees because each browser reders html a little differently. It would be hackish, and would require that you dig into the guts of the framework. In any event, it would be a lot of work. So, ask yourself, is months of coding really worth it for this feature?
Is there any way convert My Mvc Viepage in to Image when click on button it needs to convert entire Mymvc view page to imge and save it .

Browser screenshot as bitmap in WP7

I'm trying to get the screenshot of a given URL as a bitmap image on the Windows Phone. The WebBrowser class does not seem to have the DrawToBitmap method.
Any pointers on how to get this working?
Use WriteableBitmap to render the WebBrowser control and its contents to a bitmap as described by Laurent's article Taking a screenshot from within a Silverlight #WP7 application, which also explains how to save it to the media library.
You can't take a screenshot of the WebBrowser Control as there seems to be a bug with the way it works with WriteableBitmaps. An alternative method could be to send the URL to a web service which takes a screenshot on the server and returns it back to your app.

Mac dashboard widgets not loading external images

I set out to make a quick Mac OS X dashboard widget. I read the documentation and was pleased to find out they use simple HTML, JS, and CSS. I created my widget and it works when I open the .html file in Firefox, but it does not work when I install the widget to the dashboard.
The widget is simple: it displays the most recent image from a weather web cam stream. The image URLs look like this: http://webcam.com/stream.jpg?1274213999617. The timestamp is appended to the URL and the server automatically responds with the latest image for that time. I did not write the server script.
The widget appears to be loading correctly, but the web cam image will not load. Notice the blue question mark in the upper left. The image should appear over the square background image. Is there any special procedure for loading external images into a widget?
alt text http://img.skitch.com/20100518-pfesqbaby8dcg6yet8wjay7n1c.jpg
You should look here for some important settings:
Dashboard Info.plist Keys

Resources