Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 August 20th, 2004, 07:19 AM
Authorized User
 
Join Date: Aug 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Size of resized image

Hi All,

I have created a little script of code to upload an image that has been resized.

This is working fine but the problem I have is that when the image is resized and saved, the size(KB) of the image has increased.

EG. I test uploaded one of the pictures that come in the my pictures directory which had a size of around 70KB and dimensions of 800 x 600. When I resize the image to 400 x 300, the size has increased to around 300KB.

Can anyone help with this or explain why it happens,

Thanks.

Brett:(

 
Old September 5th, 2004, 11:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This is probably because you are using the System.Drawing namespace. When you open a file as an "Image" class, it lives in memory as a BMP. So when you save, it's as a raw BMP. You need to save it to a stream in the particular format you want (JPG/GIF/PNG), then save the stream to a file. Then the file will be smaller than the original.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Get image size without loading? tal Javascript How-To 3 June 30th, 2007 07:05 AM
set up image size goldenstate BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 February 15th, 2007 07:37 PM
Image size? Olaf_l ASP.NET 1.0 and 1.1 Basics 1 May 9th, 2005 05:56 AM
Image Size kilika Classic ASP Basics 2 July 18th, 2003 01:05 PM
Image size kilika Classic ASP Professional 3 July 16th, 2003 09:26 AM





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