您的位置:首页 > 其它

Windows Phone WebBrowser控件截屏无效

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

this.LayoutRoot.Arrange(new Rect(0d, 0d, 480, 800));
WriteableBitmap wbmp = new WriteableBitmap(LayoutRoot, null);
string directory = "Shared/ShellContent/screenshot";
string path = directory + "/" +...+ ".jpg";
using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!storageFile.DirectoryExists(directory))
{
storageFile.CreateDirectory(directory);
}
using (IsolatedStorageFileStream stream = storageFile.OpenFile(path, FileMode.Create))
{
wbmp.SaveJpeg(stream, wbmp.PixelWidth, wbmp.PixelHeight, 0, 100);
}
}


View Code

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

附个链接:http://social.msdn.microsoft.com/Forums/zh-CN/windowsphonezhchs/thread/babdab68-2094-4016-9cc2-2246760bf063/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: