Converting a website url into image in windows phone application - windows-phone-7

I want to convert a website into an image file.
Is there any method in .NET library or any other method to do this?(As WebsiteToImage method in C#)

You could the WriteableBitmap.Render() method, it allows you render a control to an image.
Of course you have to load the website into a control for that.

Related

Opening an image in TImage from a server

I am working on a huge project using Delphi XE5, the core of the program is to open an image using the TImage component on the application but the image is on a server that is accessed trough the internet. The image that displays depends on the criteria set trough other events or actions from the user. I already have the criteria's code etc in place, I only neet die Image display part..
What other components do I need to use other than TImage component to make this happen and how does one do this? I have been searching for answers for more than a week and couldn't find something that works.
This is also a multi platform application.
Found what I was looking for at FireMonkey iOS RAD Studio XE2 - Display Image on form loaded from URL although its a bit slow, but for now it can do the job just fine.
Well you can load a TBitmapImage or TJPEGImage from a stream and then stick it into your TImage. However, you will need to know the image type before you do this. Here is an example using TJPEGImage: JPEG data-stream to TImage

WP7: Accessing image data of WebBrowser control

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

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.

Can the HubTile Source property be set to a GIF?

I'm building an app that generates a grid of HubTile objects from the Silverlight Toolkit representing people, with the Source property being set to a URL for their profile picture that's returned from a web service. If the person hasn't uploaded a profile picture, the URL that's returned is a GIF for a generic profile picture. It appears that the HubTile simply ignores the Source, because the image isn't being displayed. I've verified that the image exists at the provided URL. Are GIF's simply an unsupported image type for the HubTile? Unfortunately, the documentation on Codeplex is empty.
No, GIF images are not supported. From "Tiles Overview for Windows Phone":
Tile images can be either a .jpg or .png file
If you are referring to the HubTile control, it uses an Image under the hood which does not support GIFs either. As per Supported Media Codecs for Windows Phone
This file type [GIF] is unsupported by the Silverlight Image element

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.

Resources