Asked by:
Image thumnails. .. .

Question
-
User-653688788 posted
How can I make the thumbnails of images at runtime.... Is there any builtin class avilable...Friday, October 6, 2006 12:41 PM
All replies
-
User2128074059 posted
You can use the Thumbnail method to resolve that problem.
Or you can use some third party component (ex. PhotoSpite.NET).
Saturday, October 7, 2006 5:58 AM -
User-653688788 posted
You can use the Thumbnail method to resolve that problem.
Can u plz give any example or article on using "Thumbnail method" ?
Sunday, October 8, 2006 1:13 AM -
User-653688788 posted
Photo sprite is an application, How can i use it in ASP.NET??Sunday, October 8, 2006 1:19 AM -
User1778685159 posted
Photo sprite is an application, How can i use it in ASP.NET??
You need to download the .NET DLL from here:
http://www.photosprite.net/Release/Trial.aspx?version=2.0
Here is a sample code on how to use the DLL:
1 private void Page_Load(object sender, System.EventArgs e) 2 { 3 // Create instance of PhotoSprite 4 Graphic MyGraphic = new PhotoSprite.Graphic(); 5 6 // Original image name 7 MyGraphic.SourceFile = Server.MapPath( "/images/demo.jpg" ); 8 // Destination image name, and can make the same as the original image name 9 MyGraphic.DestFile = Server.MapPath( "/images/tmp/thumbnail.jpg" ); 10 11 // Destination image width 12 MyGraphic.Width = 200; 13 14 // Destination image height 15 MyGraphic.Height = 200; 16 17 // Making thumbnail image 18 // This method will auto-fit the destination width and height 19 MyGraphic.Thumbnail(); 20 21 22 // Show the contrastive effect 23 SrcImage.Src = "/images/demo.jpg"; 24 DstImage.Src = "/images/tmp/thumbnail.jpg"; 25 } 26 27 28
Sunday, October 8, 2006 4:09 PM -
User90671449 posted
Or use the free BetterImageProcessor. http://www.waterwijkers.nl/bip
Cheers,
Wes
Tuesday, October 10, 2006 1:24 AM -
User-653688788 posted
You need to download the .NET DLL from here:
http://www.photosprite.net/Release/Trial.aspx?version=2.0
Here is a sample code on how to use the DLL:
1 private void Page_Load(object sender, System.EventArgs e) 2 { 3 // Create instance of PhotoSprite 4 Graphic MyGraphic = new PhotoSprite.Graphic(); 5 6 // Original image name 7 MyGraphic.SourceFile = Server.MapPath( "/images/demo.jpg" ); 8 // Destination image name, and can make the same as the original image name 9 MyGraphic.DestFile = Server.MapPath( "/images/tmp/thumbnail.jpg" ); 10 11 // Destination image width 12 MyGraphic.Width = 200; 13 14 // Destination image height 15 MyGraphic.Height = 200; 16 17 // Making thumbnail image 18 // This method will auto-fit the destination width and height 19 MyGraphic.Thumbnail(); 20 21 22 // Show the contrastive effect 23 SrcImage.Src = "/images/demo.jpg"; 24 DstImage.Src = "/images/tmp/thumbnail.jpg"; 25 }
-
Only .dll is sufficient OR I've to install PhotoSprite as well?
-
Where do I have to put .dll file?
-
The code u sent is fi9. But the problem with this code is that it creates a copy of the original image and stores it in a temporary folder. In this way it will take lot of space. I just want to show the pics as a thumbnail to my visitors, and onClicking the thumbnail, they will be able to see the full sized image. I don't want to make copies of images.
Tuesday, October 17, 2006 2:24 AM -
-
User90671449 posted
Sorry, didn't know you're not allowed to use freeware.
Cheers,
Wes
Tuesday, October 17, 2006 5:49 PM -
User2128074059 posted
-
Only .dll is sufficient OR I've to install PhotoSprite as well?
-
Where do I have to put .dll file?
-
The code u sent is fi9. But the problem with this code is that it creates a copy of the original image and stores it in a temporary folder. In this way it will take lot of space. I just want to show the pics as a thumbnail to my visitors, and onClicking the thumbnail, they will be able to see the full sized image. I don't want to make copies of images.
The answer of 1 and 2 above: only put the .Dll file to the \bin directory in your web application if you use version 2.0 which is only a .Dll file.
3. Yes, it will create a copy of the original image and store it in a temporary folder, but this means that it will not consume more memory. It, I think, enhance the server's performance and don't make other user's request wait for a long time.
If you don't want to make copies of images, you can use System.IO.File class to delete the temporary images after processing the thumbnails.
Below is the resolution you have refered to above, FYI.
1. Save the user uploaded original image.
2. Use PhotoSprite Dll to create a thumbnail of the original image to a temporary folder.
3. Copy the thumbnail to a favourite folder that you store and show it.
4. Delete all temporary images that PhotoSprite Dll created temporarily.
5. Show it from your server to client.
Tuesday, October 17, 2006 9:55 PM -
-
User494352855 posted
This resizing module is open-source... It works on the file URL... so you add ?thumbnail=jpg&width=50 to generate a resizied version of the image... Make sure you use something that has disk caching.... otherwise you'll be having serious memory, cpu, and I/O perf issues when you go live....Monday, October 6, 2008 4:32 PM