Take screenshot Webbrowser in wp7

﹥>﹥吖頭↗ 提交于 2019-12-20 05:28:31

问题


I have a code to take screenshot in wp7.

int Width = (int)LayoutRoot.RenderSize.Width;
int Height = (int)LayoutRoot.RenderSize.Height;

// Write the map control to a WwriteableBitmap
WriteableBitmap screenshot = new WriteableBitmap(LayoutRoot, new TranslateTransform());

using (MemoryStream ms = new MemoryStream())
{
    // Save it to a memory stream
    screenshot.SaveJpeg(ms, Width, Height, 0, 100);

    // Take saved memory stream and put it back into an BitmapImage
    BitmapImage img = new BitmapImage();
    img.SetSource(ms);

    // Assign to our image control
    ImageFromMap.Width = img.PixelWidth;
    ImageFromMap.Height = img.PixelHeight;
    ImageFromMap.Source = img;

    // Cleanup
    ms.Close();
}

In my screen have a webbrowser to display content in internet. when press button Take. i can take a photo of screen but webbrowser area display a white rectangle.


回答1:


Currently, there is no way to implement a screenshot over WebBrowser. But if you just want a runtime display of screenshot not store to gallery or for tile usage, you can just implement the function by put your WebBrowser control on the screenshot view. Thumbnail of WebBrowser can be implement in WPF way



来源:https://stackoverflow.com/questions/7550339/take-screenshot-webbrowser-in-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!