0

我正在使用以下代码来捕获屏幕。但是页面中的浏览器没有被捕获。

WriteableBitmap w = new System.Windows.Media.Imaging.WriteableBitmap(this, null); // 'this' is your current page
WriteableBitmap w2 = new System.Windows.Media.Imaging.WriteableBitmap(480, 800);

// space for SysTray
for (int i = 0; i < 32; i++)
{
            for (int j = 0; j < 480; j++)
            {
                w2.Pixels[i * 480 + j] = -16777216; // black #ff000000
            }
}

// actual client area
for (int i = 32; i < 728; i++)
{
            for (int j = 0; j < 480; j++)
            {
                w2.Pixels[i * 480 + j] = w.Pixels[(i - 32) * 480 + j];
            }
}

// space for AppBar
for (int i = 728; i < 800; i++)
{
            for (int j = 0; j < 480; j++)
            {
                w2.Pixels[i * 480 + j] = -16777216; // black #ff000000
            }
}

MemoryStream ms = new MemoryStream();
w2.SaveJpeg(ms, 480, 800, 0, 100);

Microsoft.Xna.Framework.Media.MediaLibrary lib = new Microsoft.Xna.Framework.Media.MediaLibrary();
ms.Position = 0;
lib.SavePicture("screenshot", ms);
4

1 回答 1

1

这是当前 Windows Phone SDK 的一个已知问题:

WriteableBitmap 当前不捕获 WebBrowser 控件或 MediaElement 的内容。

资源

于 2013-08-09T13:30:09.107 回答