[C#/WPF] FrameworkElement 캡쳐 스크린


[C#/WPF] FrameworkElement 캡쳐 스크린

일반적인 Screen Capture를 하면 Application 상단에 Topmost로 올라가 있는 화면까지 캡쳐가 됩니다. 이러한 것을 방지하기 위해 RenderTargetBitmap를 이용하여 캡쳐하는 예제입니다. public static void ScreenCapture(FrameworkElement fr, string outFilePath) { // System.Windows.Media.VisualTreeHelper를 이용하여 FrameworkElement의 영역을 가져옵니다. Rect bounds = VisualTreeHelper.GetDescendantBounds(fr); // 대상의 좌표를 렌더링 대상 디바이스로 변환하는 데 사용할 수 있는 행렬정보를 가져옵니다. Matrix m = Pre..


원문링크 : [C#/WPF] FrameworkElement 캡쳐 스크린