您的位置:首页 > 编程语言

Windows phone screenshot 截图 代码

2012-03-06 20:54 330 查看
看了Alexis的文章,/article/4705598.html

关于windows phone屏幕截图的,

试了一下,屏幕翻转在landscape的状态下,截图貌似有问题,

于是google了一下,

发现如下代码:(http://blog.markarteaga.com/ScreenCaptureOnWindowsPhone7.aspx)

private void btnCaptureScreen_Click(object sender, RoutedEventArgs e)
{
//Capture the screen and set it to the internal picture box
WriteableBitmap bmp = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
bmp.Render(this, null);
bmp.Invalidate();
//this.image1.Source = bmp;

//Set a new background
//ImageBrush brush = new ImageBrush();
//brush.ImageSource = new BitmapImage(new Uri(NextImage,UriKind.Relative));
//ContentGrid.Background = brush;

}


经尝试,可成功截图。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: