Windows Phone WebBrowser控件截屏无效

项目开发中,需要用到代码截取页面,存储为图片这样一个功能。实现起来并不难,代码也简单:

 1 this.LayoutRoot.Arrange(new Rect(0d, 0d, 480, 800));
 2             WriteableBitmap wbmp = new WriteableBitmap(LayoutRoot, null);
 3             string directory = "Shared/ShellContent/screenshot";
 4             string path = directory + "/" +...+ ".jpg";
 5             using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication())
 6             {
 7                 if (!storageFile.DirectoryExists(directory))
 8                 {
 9                     storageFile.CreateDirectory(directory);
10                 }
11                 using (IsolatedStorageFileStream stream = storageFile.OpenFile(path, FileMode.Create))
12                 {
13                     wbmp.SaveJpeg(stream, wbmp.PixelWidth, wbmp.PixelHeight, 0, 100);
14                 }
15             }
View Code

 

现在要实现截取一个包含WebBrowser控件的页面,待WebBrowser控件加载完成内容后,希望可以把内容截取出来。截取完成后却发现图片上面是空白,并没有WebBrowser控件加载的内容,也查了些资料,说是Windows Phone的WebBrowser控件不支持抓图,截屏无效。也不知道有没有什么其他解决办法!!

附个链接:http://social.msdn.microsoft.com/Forums/zh-CN/windowsphonezhchs/thread/babdab68-2094-4016-9cc2-2246760bf063/

posted on 2013-06-08 11:27  ljpass6754  阅读(177)  评论(0编辑  收藏  举报

导航