Dreamine.UI.Wpf
1.0.1
Dreamine.UI.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
IconToImageSourceConverter.cs
이 파일의 문서화 페이지로 가기
1
using
System;
2
using
System.Diagnostics;
3
using
System.Drawing;
4
using
System.Globalization;
5
using
System.Windows;
6
using
System.Windows.Data;
7
using
System.Windows.Interop;
8
using
System.Windows.Media;
9
using
System.Windows.Media.Imaging;
10
11
namespace
Dreamine.UI.Wpf.Converters
;
12
21
public
class
IconToImageSourceConverter
: IValueConverter
22
{
79
public
object
Convert
(
object
value, Type targetType,
object
parameter, CultureInfo culture)
80
{
81
var icon = value as Icon;
82
if
(icon ==
null
)
83
{
84
Trace.TraceWarning(
"Attempted to convert {0} instead of Icon object in IconToImageSourceConverter"
, value);
85
return
null
!;
86
}
87
88
ImageSource imageSource = Imaging.CreateBitmapSourceFromHIcon(
89
icon.Handle,
90
Int32Rect.Empty,
91
BitmapSizeOptions.FromEmptyOptions());
92
return
imageSource;
93
}
94
151
public
object
ConvertBack
(
object
value, Type targetType,
object
parameter, CultureInfo culture)
152
{
153
throw
new
NotImplementedException();
154
}
155
}
Dreamine.UI.Wpf.Converters
Definition
AddOffsetConverter.cs:10
Dreamine.UI.Wpf.Converters.IconToImageSourceConverter
Definition
IconToImageSourceConverter.cs:22
Dreamine.UI.Wpf.Converters.IconToImageSourceConverter.ConvertBack
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Definition
IconToImageSourceConverter.cs:151
Dreamine.UI.Wpf.Converters.IconToImageSourceConverter.Convert
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Definition
IconToImageSourceConverter.cs:79
Converters
IconToImageSourceConverter.cs
다음에 의해 생성됨 :
1.17.0