Private Function ResizePicture(ByVal objCtrl As Object,ByVal dblWidthRate As Double,ByVal dblHeightRate As Double) As Integer If objCtrl.Image Is Nothing Then Exit Function Dim intWidth%,intHeight% Dim objImg As System.Drawing.Image = objCtrl.Image intWidth = objImg.Width '获得原始image的大小 intHeight = objImg.Height Dim objBmp As New Bitmap(CInt(intWidth * dblWidthRate),CInt(intHeight * dblHeightRate)) '创建画布(画布大小即扩缩后的大小) Dim objG As Graphics = Graphics.FromImage(objBmp) '载入objG的操作画布objBmp objG.Clear(Color.White) '背景设为白色 objG.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBilinear '高质量 objG.DrawImage(objCtrl.Image,New Rectangle(0,CInt(intWidth * dblWidthRate),CInt(intHeight * dblHeightRate))) objCtrl.Image = objBmp End Function