C#中Bitmap 类实现对图像操作的一些方法 导入以下两个包: System
Drawing; System
Drawing
Imaging; 建产对象: Bitmap bm = new Bitmap("c:/1
bmp"); 缩放: Bitmap bm1 = new Bitmap(bm,width,height); 格式转换: bm
save("c:/1
jpg",ImageFromat
Jpeg); bm1
Save("c:/1
gif", ImageFormat
Gif); 剪切一个区域: //剪切大小 int cutwidth; int cutheight; Graphics g; //以大小为剪切大小,像素格式为 32 位 RGB 创建一个位图对像 Bitmap bm1 = new Bitmap(width,height,PixelFormat
Format32bppRgb) ; //定义一个区域 Rectangle rg = new Rectangle(0,0,cutwidth,cutheight); //要绘制到的位图 g = Graphics
FromImage(bm1); //将 bm 内 rg 所指定的区域绘制到 bm1 g
DrawImage(bm,rg); asp
net(c#)-放大缩小图片尺寸 /// /// 放大缩小图片尺寸 /// /// /// /// /// public void picsized(string picpath, string resizepicpath, int isize, imageformat format) { bitmap originbmp = new bitmap(picpath); int w = originbmp
width * isize; int h = originbmp
height *