Loading a large amount of images to be displayed in a WrapPanel

后端 未结 5 1277
故里飘歌
故里飘歌 2020-12-16 02:17

I am using Entity Framework Code First

I have a Movie like so:

public class Movie
{
        public byte[] Thumbnail { get; set; }
           


        
5条回答
  •  不思量自难忘°
    2020-12-16 02:47

    Do you want to load all the images at once? (I recon not all 4000+ movie thumbnails will be shown on screen at the same time). The easiest way I think you could achieve this is to load the images when needed (e.g. only load the ones that are showing and dispose of these (to conserve memory) when not showing).

    This should speed up things since you only have to instantiate the objects (and let the ObservableCollection points to the memory address of the objects) and again only load images when needed.

    hints to an answer are:

    Divide the screen in blocks (pages)
    And upon changing the index load the new images (you've already got an observable collection list)

    If you still run into difficulties I'll try to give a more clear answer :)

    Goodluck

提交回复
热议问题