It's me again...

I've spent a few hours today trying to figure out how to properly resize a jpg image programmatically...

hellswraith has helped me out a bunch already, giving me a very nice example to start off with... but i've found that using GDI+ (at least in the way i'm using it) doesn't properly.. my resized image looks to be very low quality, even when i try saving it with the jpg quality at 100...

here's the sub i'm using to resize the image:
VB Code:
  1. Function ResizeImage(ByVal MaxWidth As Integer, ByVal MaxHeight As Integer, ByVal Image As Bitmap) As Bitmap
  2.  
  3.         Dim ScaleFactor As Decimal
  4.         Dim NewSize As SizeF
  5.  
  6.         If CInt(Image.Size.Width) > MaxWidth Or CInt(Image.Size.Height) > MaxHeight Then
  7.  
  8.             If CInt(Image.Size.Width) > CInt(Image.Size.Height) Then
  9.                 'Image Width is too big
  10.                 ScaleFactor = CDec(MaxWidth / CInt(Image.Size.Width))
  11.  
  12.             Else
  13.                 'Image Height is too big
  14.                 ScaleFactor = CDec(MaxHeight / CInt(Image.Size.Height))
  15.             End If
  16.  
  17.             NewSize.Width = Image.Size.Width * ScaleFactor
  18.             NewSize.Height = Image.Size.Height * ScaleFactor
  19.  
  20.             'Return the resized image
  21.             ResizeImage = Image.GetThumbnailImage(NewSize.Width, NewSize.Height, Nothing, Nothing)
  22.  
  23.         End If
  24.     End Function


Now, here's the original image i'm starting with:



Here's the image that my code resizes: (Keep in mind, the way i saved this image, i used jpeg encoder at a quality of 100)



And Finally, here's what Photoshop ends up with when it resizes my image to the same size as my code:



So, as you can see, my code doesn't do the job... So, i'm still looking for a proper way to do this, be it through a 3rd party .NET library, or code... i would PREFER to have code to do this in .NET myself, but if nothing else, i guess 3rd party would have to suffice... thanks for the help guys!