Results 1 to 11 of 11

Thread: High Quality Image Resizing

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    High Quality Image Resizing

    By changing interpolation mode (the algorithm used to resize) on a graphics object, you can resize your images and keep their quality.

    It will use more cpu time then usual, that's why "nearest neighbour" is the traditionally used algorithm, as it is a low cpu cost method.

    Here's is a function to resize your Images at a high quality

    Code:
        Private Function SizeImage(ByVal img As Bitmap, ByVal width As Integer, ByVal height As Integer) As Bitmap
            Dim newBit As New Bitmap(width, Height) 'new blank bitmap
            Dim g As Graphics = Graphics.FromImage(newBit)
            'change interpolation for reduction quality
            g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
            g.DrawImage(img, 0, 0, width, Height)
            Return newBit
        End Function
    Last edited by Phill64; Dec 17th, 2007 at 03:29 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width