0

Is there anyway to get a Screenshot of the current content shown in a WebBrowser control element in WP8? The documentation says that the WebBrowser control element is the same used by the Internet Explorer on the phone, and the IE has the "tabs" view where you can see the last visited pages and a small picture with the content of those pages.

Kevin Gosse
  • 38,392
  • 3
  • 78
  • 94
David
  • 3,971
  • 1
  • 26
  • 65
  • Possible duplicate? http://stackoverflow.com/questions/7550339/take-screenshot-webbrowser-in-wp7 – Neil Turner Jun 06 '13 at 22:57
  • Yup, basically a dupe. There is no way to way to render the contents of a WebBrowser control to a WriteableBitmap (or other construct) in WP8 or 7.5. – Oren Jun 07 '13 at 05:00

2 Answers2

0

I havn't find the solution of this problem (screenshot of the webBrowser).

But,You have a temporary solution for display the page called by user in history page for sample...

When you called a webpage, save the SourceCode of the page. And, in your history, add the source code in a WebBrowser element locked...

User can see this history webpage...

BUT, this method have two problems (it's for that is just "temporary method" ):

First is if when you display the source code in webbrowser, this reload, the element (and use data connection) with an image, No data Connection was used...

Second is if you save the source code of the page web in time X, you save also the path on the video/images/css/js of the webpage.

And, maybe in Time Y, the webPage content has modify, and images can't be reload... source code became obsolete...

Doc Roms
  • 3,288
  • 1
  • 20
  • 37
  • I came across another idea now. Isn't it possible to transfer the content of one WebBrowser element to another? Another solution would be to load the site on the Recents-View in the mini WebBrowser element, but that's not a good solution because you would be downloading the site again and again and again. – David Jun 07 '13 at 15:04
0

Try this

  UIElement scrollContent = (UIElement)this.LayoutRoot;
            bmpCurrentScreenImage.Render(LayoutRoot, new MatrixTransform());
            bmpCurrentScreenImage.Invalidate();


            SaveToMediaLibrary(bmpCurrentScreenImage, fileName, 100);


public void SaveToMediaLibrary(WriteableBitmap bitmap, string name, int quality)
        {
            using (var stream = new MemoryStream())
            {
                // Save the picture to the Windows Phone media library.
                bitmap.SaveJpeg(stream, bitmap.PixelWidth, bitmap.PixelHeight, 0, quality);
                stream.Seek(0, SeekOrigin.Begin);
                     IsolatedStorageFileStream fileStream = _storageFile.CreateFile("folderName" + fileName);
            BitmapImage bitmap = new BitmapImage();
            bitmap.SetSource(imageStream);

            WriteableBitmap wb = new WriteableBitmap(bitmap);
            wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, orientation, quality);
            fileStream.Close();
               // new MediaLibrary().SavePicture(name, stream);
            }
        }

this will save the browser contents in to image file in isolated storage

pranavjayadev
  • 937
  • 7
  • 31