markus / KCOM / Common / Converter / CmpUrlChange.cs @ d18ea2bd
이력 | 보기 | 이력해설 | 다운로드 (1.14 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Globalization; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Windows.Data; |
||
7 | |||
8 | namespace KCOM.Common.Converter |
||
9 | { |
||
10 | public class ImageUrlConverter : IValueConverter |
||
11 | { |
||
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
||
13 | { |
||
14 | if (value is null) |
||
15 | { |
||
16 | return null; |
||
17 | } |
||
18 | else if(value is Uri) |
||
19 | { |
||
20 | //var url = (value as Uri).OriginalString.Replace(".jpg",".cmp"); |
||
21 | var url = (value as Uri).OriginalString; |
||
22 | return url; |
||
23 | //using (Leadtools.Codecs.RasterCodecs codecs = new Leadtools.Codecs.RasterCodecs()) |
||
24 | //{ |
||
25 | // return codecs.Load(ViewerDataModel.Instance.GetStreamFromUrl(url), 0, Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray, 1, 1); |
||
26 | //} |
||
27 | } |
||
28 | return null; |
||
29 | } |
||
30 | |||
31 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
||
32 | { |
||
33 | throw new NotImplementedException(); |
||
34 | } |
||
35 | } |
||
36 | } |