Reply to topic
Uploading, Saving and Displaying a Photo/ Image in .Net C#
rickvidallon


Joined: 15 Nov 2004
Posts: 26
Location: Virginia Beach,VA
Reply with quote
I have a .Net application written in C# where members may upload their photos and have them displayed on our website. We are trying to maintain the best quality using best settings in .Net for this.

A good commercial comparison is as follows;
I uploaded a photo to www.flickr.com. http://www.flickr.com/photos/visionefx/446635882/in/photostream/
The photo contains 73076 kbs. --- When I upload the 'same photo' to our application it saves it at 13076 kbs. That's nice for speed but not very good for quality.

Here is the settings we are using:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
System.Drawing.

Image image1 = System.Drawing.Image.FromFile(Server.MapPath(imgfilepath + actimgFilename));
System.Drawing.

Image smallimage = new Bitmap (imgNewWidth, imgNewHeight, image1.PixelFormat);

Graphics oGraphic = Graphics.FromImage(smallimage);
oGraphic.CompositingQuality =

CompositingQuality.HighQuality;
oGraphic.SmoothingMode =

SmoothingMode.HighQuality;
oGraphic.InterpolationMode =

InterpolationMode.HighQualityBicubic;
oGraphic.PixelOffsetMode =

PixelOffsetMode.HighQuality;

Rectangle oRectange = new Rectangle (0, 0, imgNewWidth, imgNewHeight);
oGraphic.DrawImage(image1, oRectange);

smallimage.Save(Server.MapPath(imgfilepath + newFilename), System.Drawing.Imaging.

ImageFormat.Jpeg);
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Thanks in advance,
Rick
Uploading, Saving and Displaying a Photo/ Image in .Net C#
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic