namespace VideoBrowser.Helpers
{
using System.Drawing;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
///
/// Defines the .
///
public static class ImageHelper
{
#region Methods
///
/// The ToImageSource.
///
/// The icon.
/// The .
public static ImageSource ToImageSource(this Icon icon)
{
var imageSource = Imaging.CreateBitmapSourceFromHIcon(
icon.Handle,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
return imageSource;
}
#endregion Methods
}
}