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();
}
私の画面には、インターネットでコンテンツを表示するための Web ブラウザーがあります。ボタンを押すとテイク。画面の写真を撮ることはできますが、Web ブラウザー領域に白い四角形が表示されます。