给定一幅图,我需要剪切图的最左边一列象素,并且做了拉伸,为啥取出来的图总是不对啊?代码如下请高手帮忙看下,谢谢!Bitmap img = Bitmap.FromFile(@"D:\abc.bmp");//指定要处理的图;Bitmap bm = new Bitmap(1, img.Height);//定义一个新图,一个像素宽,原始图片的高度Graphics temp = Graphics.FromImage(bm);
Rectangle reg = new Rectangle(new Point(0, 0), bm.Size);
temp.DrawImageUnscaledAndClipped(img, reg);//从图中剪切Rectangle regBack = new Rectangle(new Point(0, 0), new Size(this.Width, this.Height));
g.DrawImage(bm, regBack);//把新图拉伸到控件的Size.