wp7 화면 캡처 코드
1423 단어 wp7
public void CaptureScreen(object sender, EventArgs e)
{
WriteableBitmap bmp = new WriteableBitmap(480, 800);
bmp.Render(App.Current.RootVisual, null);
bmp.Invalidate();
MemoryStream stream = new MemoryStream();
bmp.SaveJpeg(stream, bmp.PixelWidth, bmp.PixelHeight, 0, 80);
stream.Seek(0, SeekOrigin.Begin);
MediaLibrary library = new MediaLibrary();
string filename = "ScreenShot_" + DateTime.Now.ToString("yyyy-MM-dd_hh:mm:ss");
library.SavePicture(filename, stream);
stream.Close();
}