开发者

Is it possible to load different size and weight images from one cloumn image Data Type?

开发者 https://www.devze.com 2023-01-10 21:25 出处:网络
I\'m going to design a database for an image gallery in ASP.NET Web App . Because of some reasons I\'ve decided to store the image in Data Base , Not the address .

I'm going to design a database for an image gallery in ASP.NET Web App . Because of some reasons I've decided to store the image in Data Base , Not the address .

In the application i need two or more different size and weight image for each image that the admin insert .For instance , One of them is 开发者_如何学Csmall and lightweight thumbnail , and the other is Original big one .

My question is : Should i have two column ( one for lightweight and small thumbnail and one for big and full size one ) in DataBase Or Is there any way i could load different size and wight image from Big and original image column ?

Hope i could get it across .

Thank you


Though you have decided to store image in database it is really bad for performance so please use some caching.

Now answer: YES you can scale down original image to show a thumbnail but if your user does not need to view each original image for which thumbnail is shown you may be burdening db server to get full image. In this case storing both thumbnail and original will be better.

If you show full image for every thumbnail then you can simply download full image and get thumbnail from it. To get thumbnail use this function:

Image thumb = fullImage.GetThumbnailImage(50, 50, null, new System.IntPtr());
0

精彩评论

暂无评论...
验证码 换一张
取 消