Graphics g=this.pictureBox1.CreateGraphics();
g.Clear(this.pictureBox1.BackColor);
g.ScaleTransform(0.9F,0.9F); g.DrawImage(image1,this.pictureBox1.ClientRectangle,0,0,a,b,GraphicsUnit.Pixel);
那位能给出发大和缩小的原码参考下,万分感激。
g.Clear(this.pictureBox1.BackColor);
g.ScaleTransform(0.9F,0.9F); g.DrawImage(image1,this.pictureBox1.ClientRectangle,0,0,a,b,GraphicsUnit.Pixel);
那位能给出发大和缩小的原码参考下,万分感激。
Rectangle expansionRectangle = new Rectangle(10, 10,myBitmap.Width*2, myBitmap.Height*2);
Rectangle compressionRectangle = new Rectangle(10, 10,myBitmap.Width / 2, myBitmap.Height/2);
Graphics g=this.pictureBox1.CreateGraphics();
g.DrawImage(myBitmap, 10, 10);
g.DrawImage(myBitmap, expansionRectangle);
g.DrawImage(myBitmap, compressionRectangle);
Graphics g=this.pictureBox1.CreateGraphics();
//放大
Rectangle expansionRectangle = new Rectangle(400, 10,myBitmap.Width*2, myBitmap.Height*2);
g.DrawImage(myBitmap, expansionRectangle);
//缩小
Rectangle compressionRectangle = new Rectangle(800, 10,myBitmap.Width / 2, myBitmap.Height/2);
g.DrawImage(myBitmap, compressionRectangle);
//不变
g.DrawImage(myBitmap, 10, 10);