Reputation: 672
I have been wanting to get a thumbnail of websites for quite some time using the web browser control in Windows Phone.
My Question is quite simple, is there a way to gaining a thumbnail of the web page a user is currently on. I have done this before using C# standard web browser control and the DrawToBitmap method but this doesn't exist in Windows Phone (Atleast I was unable to find any documentation suggesting otherwise)
If there is anything you guys know that could point me in the right direction besides using online services such a glimpse or Amazon's Thumbnail Generators as I would like to keep this activity within the app, I don't want to do extra calls to another web service when the data is right there in their web browser.
I was hoping if there was a invoke script I don't know about or some libraries that are supported in Windows Phone which are able to do just this.
Thanks for your help, if you require more information just ask, or if you would like to know what or why I want this I will explain further here:
I have a News App that allows users to access a select few feeds, I have a dedicated page that hosts the web browser control to display the webpage with some other functionality like sharing the website using your email or pinning the web site to your home screen, I just want a more custom experience than the generic web browser one. And I think a thumbnail of the website would be nice as the Tiles background
If you have a better Idea on how to tackle something like this please do let me know I am open to suggestions :)
Upvotes: 1
Views: 439
Reputation: 70142
You could try rendering the browser control to a WriteableBitmap
:
var bitmap = new WriteableBitmap(400, 400);
bitmap.Render(browserControl, null);
bitmap.Invalidate();
You can then use this bitmap as an ImageSource
.
Upvotes: 1