Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 October 12th, 2010, 08:38 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default Resized image

Hello,

I have very basic knowledge of ASP.net. I am using following script to resize and image, but the problem is it increases the disk volume of resized image to almost 4 times or original image.

Example:
Original Image: 1024 x 769px and Disk space: 135 KB
Resized Image: 600 x 380px and Disk space: 725KB


HTML Code:
	 dim g1 as System.Drawing.Image = System.Drawing.Image.FromFile(txtGetImage)  
	 dim thisFormat1=g1.rawformat  

	 '#600
     height = g1.Height / (g1.Width / 600)
			 
	 dim imgOutput1 as New Bitmap(g1, 600, height)  
	 imgOutput1.Save(txtMedium)
         g1.dispose()
	 imgOutput1.dispose()  

Any idea, any help will be greatly appriciated.


Thanks!
 
Old October 12th, 2010, 08:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hello, Doing this you are storing the new file as a bitmap, aren't you?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old October 13th, 2010, 07:14 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

Quote:
Originally Posted by gbianchi View Post
Hello, Doing this you are storing the new file as a bitmap, aren't you?
Thanks for your response.
The original file format can be JPG, JPEG or GIF. I have to save the new file in JPG or GIF format.
 
Old June 14th, 2011, 04:07 AM
Registered User
 
Join Date: Jun 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.authorcode.com/making-ima...size-an-image/





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 to: Upload image to server and save image name in db with other form info Clint PHP How-To 1 October 26th, 2009 05:50 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
Controls get resized automatically manu_cm Pro Visual Basic 2005 0 March 12th, 2007 12:20 AM





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