728x90
반응형
728x170
using System.IO;
using System.Windows.Media.Imaging;
#region 비트맵 구하기 - GetBitmap(bitmapSource)
/// <summary>
/// 비트맵 구하기
/// </summary>
/// <param name="bitmapSource">비트맵 소스</param>
/// <returns>비트맵</returns>
public System.Drawing.Bitmap GetBitmap(BitmapSource bitmapSource)
{
PngBitmapEncoder encoder = new PngBitmapEncoder();
MemoryStream stream = new MemoryStream();
encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
encoder.Save(stream);
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(stream);
return bitmap;
}
#endregion
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] VisualStateManager 엘리먼트 : 컨트롤 템플리트 내에서 사용하기 (0) | 2021.02.15 |
---|---|
[C#/WPF] FlowDocument 클래스 : RTF 파일 로드하기 (0) | 2021.02.15 |
[C#/WPF] FlowDocument 클래스 : RTF 파일을 XAML로 변환하기 (0) | 2021.02.15 |
[C#/WPF] DependencyProperty 클래스 : OverrideMetadata 메소드를 사용해 표준 의존 속성 디폴트 값 설정하기 (0) | 2021.02.14 |
[C#/WPF] Shape 클래스 : 커스텀 파일 슬라이스(Pie Slice) 사용하기 (0) | 2021.02.14 |
[C#/WPF] BitmapSource 클래스 : WINFORM Bitmap 객체 구하기 (0) | 2021.02.14 |
[C#/WPF] RenderTargetBitmap 클래스 : Image 객체에서 비트맵 구하기 (0) | 2021.02.14 |
[C#/WPF] MultiSelector 클래스 : 선택/이동/크기 변경 가능한 캔버스 사용하기 (0) | 2021.02.13 |
[C#/WPF] Canvas 클래스 : 자식 엘리먼트 드래그하기 (0) | 2021.02.13 |
[C#/WPF] ListBox 클래스 : 확장 가능한 리스트 박스 사용하기 (0) | 2021.02.12 |
[C#/WPF] 누겟 설치 : System.Windows.Interactivity.WPF (0) | 2021.02.12 |
댓글을 달아 주세요