프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Common / Converter / CmpUrlChange.cs @ 787a4489

이력 | 보기 | 이력해설 | 다운로드 (1.14 KB)

1
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
}
클립보드 이미지 추가 (최대 크기: 500 MB)