Resize Image
Resizes the given image to the specified width and height using high-quality rendering settings.
This function uses HighQualityBicubic interpolation mode and other high-quality graphics settings to produce smooth and visually appealing results when resizing.
VB
Public Function ResizeImage(img As Image, width As Integer, height As Integer) As Bitmap
Dim bmp As New Bitmap(width, height)
Using g As Graphics = Graphics.FromImage(bmp)
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
g.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
g.DrawImage(img, 0, 0, width, height)
End Using
Return bmp
End Function