728x90

 



List<string> list_str = new List<string>();


Remove

RemoveAt

RemoveAll

RemoveRange

728x90
728x90

이미지를 불러와서 사용하고 다시 다른 이미지를 불러온다면 오류가 발생 합니다.


오류 방지하는 방법 :

사진을 사용할 때 프로그램이 사진에 접근중이어서 생기는 문제를 방지하기 위해 이미지만 로드하고 접근을 닫아주면 됩니다.


사용방법 : 

   public static BitmapImage getImageSource(string UriPath)
        {
            BitmapImage image = new BitmapImage();

            image.BeginInit();

            image.CacheOption = BitmapCacheOption.OnLoad;

            image.UriSource = new Uri(UriPath);

            image.EndInit();

            return image;

        } 




ps. https://docs.microsoft.com/ko-kr/dotnet/api/system.windows.media.imaging.bitmapimage.endinit?view=net-5.0

728x90

+ Recent posts