Groups | Blog | Home
all groups > dotnet drawing api > february 2008 >

dotnet drawing api : Resizing and Compressing to certain limits


sbparsons
2/3/2008 10:42:00 AM
I have a client that requests that I take an image off the server and resize
it according to their specific dimensions. For example, take a 3M image (say
900x1200) and resize it to 600x800 (resolution of 100) with a file size of
max. 150k.

Is this possible through GDI+ ?

I am familiar with changing the resolution and the compression ratios
through the Encoders etc. but was wondering if it's possible to calculate the
compression ratio required to get a specific resultant filesize, taking the
sbparsons
2/4/2008 4:11:01 AM
Thanks Bob - I was after confirmation of this for the client, which you have
provided. I have been using the info from your site for the other aspects and
it has been very helpful.

Regards,
Sean

[quoted text, click to view]
Bob Powell [MVP]
2/4/2008 10:38:08 AM
Changing the size of an image is simple. Changing the resolution is simple,
specifying a compression ratio that gives you a specific file size is
nigh-on impossible.

Check out my site for information on all of the above techniques (setting
the compression ratio, not guaranteeing the filesize)

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


[quoted text, click to view]
AddThis Social Bookmark Button