Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2003, 03:20 PM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default crop image

hi coluld anyone come up with an example of how to use the code posted by "PLANIOE" here ?

http://p2p.wrox.com/topic.asp?TOPIC_ID=5995

it the imagetools class im refering to


 
Old November 12th, 2003, 04:36 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

'Retrieve an image file off of disk, resize it to a maximum size, then save to a stream as a jpeg
objImage = System.Drawing.Image.FromFile(sFullFileName)
If Not objImage Is Nothing Then
    ImageTools.Resize.ToMaxDimensions(objImage, m_nViewHeight, m_nViewWidth).Save(objStream, System.Drawing.Imaging.ImageFormat.Jpeg)
End If

'Take an image object, resize as a thumbnail of maximum dimensions, then save to a stream as an jpeg
ImageTools.Thumbnail.ToMaxDimensions(objImage, m_nThumbNailSize, m_nThumbNailSize).Save(objStream, System.Drawing.Imaging.ImageFormat.Jpeg)


The reason for "Resize" vs. "Thumbnail" is that when you use the Thumbnail method that is used by the internal code, it creates a lower quality image. When I wrote those tools, I found that some images resized poorly to larger image sizes which kind of makes sense. There's little reason for a really high quality image if it's going to be a thumbnail simply by nature.

I wrote these tools for this photo browser application I made. All my digital photos (at high res) get dumped into a directory structure, and the applications reads those and builds thumbnails on the fly and shows the images at a specified size for "full view" suitable for viewing online.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
How Can I Crop An Image in ASP Lucy Classic ASP Professional 9 January 20th, 2011 01:40 AM
Copy kodak image edit control's image to clipboard vishwanathduddilla Visual Studio 2005 0 November 3rd, 2008 10:10 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
Document Image Processing (DIP) - changing image f ALcom Access 0 March 27th, 2006 06:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.