CODEKILLER

알림 : [namoosystem.com] Codekiller 나무의사 빨간펜 인강, 재해위험성 검토의견서 QGIS 강의

반응형

▶특정 file path의 파일을 ImageSource로 return 하기

    public static ImageSource ReturnImageSourceFromLocalFile(string filePath)
    {
        if (!File.Exists(filePath))
            return null;

        BitmapImage bi = new BitmapImage();
        bi.BeginInit();
        bi.CacheOption = BitmapCacheOption.OnLoad;
        bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
        bi.UriSource = new Uri(filePath);
        bi.EndInit();

        return bi;
    }
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band