111,093
社区成员




Graphics gg = ImgFromPC.CreateGraphics();
gg.DrawImage(bp,new Rectangle(0,0,256,256));
Bitmap bp = new Bitmap(256, 256);
ImgFromPC.DrawToBitmap(bp,ImgFromPC.ClientRectangle);
//Bitmap bmp = (Bitmap)this.pictureBox1.Image;
Bitmap bmp = new Bitmap(this.pictureBox1.Image.Width, this.pictureBox1.Image.Height);
Graphics g = Graphics.FromImage(bmp);
g.DrawImage(this.pictureBox1.Image, 0, 0);
g.Dispose();
由于Bitmap是Image的子类,可以直接强制转换。
或者创建一个Bitmap,然后把Image画上去就OK。