看到这里
public Image ResizeImage( Image img, int width, int height )
{
Bitmap b = new Bitmap( width, height ) ;
using(Graphics g = Graphics.FromImage( (Image ) b ))
{
g.DrawImage( img, 0, 0, width, height ) ;
}
return (Image ) b ;
}
Run Code Online (Sandbox Code Playgroud)