loading small version of images at page load

2019-09-19 03:10发布

I'm using VS2010,C# to develop my ASP.NET web app, I display several big images (around 50KB in size) in a page, and it takes time, of course initially just some small versions of these images are displayed, then user can click on each image and the real size image would be displayed in a lightbox. But as I load the full size images for displaying the thumbnails, it takes a lot of time for loading the page, is there any way that I can load only a small size of each image? is there any way that I can reduce my load time and display thumbnails of images? what are my options, help me please

标签: asp.net image
3条回答
劫难
2楼-- · 2019-09-19 03:41

you can do two things one create thumbnail and load them rather loading your main images and also you can imply lazy loading means you only load images those are immediately required in viewport that will certainly help your cause.

Link for lazy loading

查看更多
趁早两清
3楼-- · 2019-09-19 03:54

best to use Thumbviewer. It is so easy to use and you'll be surprise how efficient it works.

<bri:ThumbViewer ID="ThumbViewer2" runat="server" ImageUrl="~/images/Scissors.jpg"
                    Title="Tailors Scissors" ThumbUrl="~/thumbs/Scissors.jpg" Height="75px" Width="90px" ModalImagePadding="40px" />

you can find demo here : Thumbnail-Image-Viewer-Control-for-ASP.Net

查看更多
The star\"
4楼-- · 2019-09-19 03:55

No, there is no way. If you create a thumbnail on the fly, the whole image has to be loaded, which defeats the purpose.

You could create the thumbnails ahead of time.

查看更多
登录 后发表回答