简体   繁体   中英

Fast way of loading high resolution image

had a project called Time Lapse Viewer which opens a folder with thousands of images and animates them using Timer.

The application is written in XAML by teh way and the code below is what I used to load the image.

bi = new BitmapImage();
bi.BeginInit();
bi.DecodePixelWidth = 720;
bi.CacheOption = BitmapCacheOption.OnLoad;
bi.UriSource = new Uri(this.ImageFilenames[this._image_index]);
bi.EndInit();
this.imgImage.Source = bi;

The images being loaded are from the DSLR and these images has 1536x2034 resolution and about 1.30+MB of size.

The code above is already fast enough to load the image in 720p but there are some noticable lag. I understand that when the image gets loaded for the first time, it requires some bit of time.

Is there anymore faster way to load an image other than loading them as a thumbnail?

Thanks.

  • You can load ina separate thread (BiatmapImage CAN be accessed from another thread when it is frozen - call Freeze after loading).
  • You can do that in multiple threads

But that is it. This is why most systems prepare thumbnails and store them in a separate file for repeated use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM