Thanks for all the help people! This is a great vb.net forum.
--
Private Function Crop(ByVal Source As Bitmap, ByVal x As Int32, ByVal y As Int32, ByVal width As Int32, ByVal height As Int32) As Bitmap
Dim Cropped As New Bitmap(width, height)
Dim g As Graphics = Graphics.FromImage(Cropped)
g.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
Dim rect As New Rectangle(0, 0, width, height)
g.DrawImage(Source, rect, x, y, width, height, GraphicsUnit.Pixel)
Return Cropped
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.