16 lines
451 B
C#
16 lines
451 B
C#
|
|
using System;
|
|||
|
|
using System.Windows;
|
|||
|
|
using System.Windows.Interop;
|
|||
|
|
using System.Windows.Media.Imaging;
|
|||
|
|
|
|||
|
|
namespace Szmedi.Toolkit.Extensions
|
|||
|
|
{
|
|||
|
|
public static class BitmapExtensions
|
|||
|
|
{
|
|||
|
|
public static BitmapSource ToBitmapSource(this System.Drawing.Bitmap bitmap)
|
|||
|
|
{
|
|||
|
|
return Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|