WPF 스크린 캡쳐 기능
·
사소한 아이의 소소한 스킬/C#
WPF에서 스크린 캡쳐WPF에서 스크린 캡쳐는 기본적으로 위의 윈폼에서의 스크린 캡쳐와 같다. 즉, 화면크기 만큼의 Bitmap 객체를 할당하고, 여기에 Graphics의 CopyFromScreen() 메서드를 사용하여 화면을 복사해서 넣으면 된다. 단 화면 크기를 구하는 System.Windows.Forms.Screen 을 WPF에서 사용하지 않고 대신 System.Windows.SystemParameters.PrimaryScreenWidth와 SystemParameters.PrimaryScreenHeight 를 사용하게 된다.코드using System.Drawing;using System.Drawing.Imaging;using System.Windows;namespace ScreenCopyWpf{ ..