private void button2_Click(object sender, EventArgs e)
{
int iWidth = this.pictureBox1.Width; //图像宽度
int iHeight = this.pictureBox1.Height; //图像高度
Graphics g = this.pictureBox2.CreateGraphics(); //创建Graphics对象实例
g.Clear(Color.White); //初始为白色
for (int x = 0; x <= iWidth / 2; x++) //扩展图像
{
Rectangle DestRect = new Rectangle(iWidth / 2 - x, iHeight / 2 - x, 2*x,2* x);
Rectangle SrcRect = new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height);
g.DrawImage(pictureBox1.Image, DestRect, SrcRect, GraphicsUnit.Pixel);
System.Threading.Thread.Sleep(10);//图片显示速度
}
}
想在pictureBox2中将picture1中图片以由里到外扩展方式显示出来,但是显示出来的图片只是picturebox1中的一部分,怎么完整的显示出来?
{
int iWidth = this.pictureBox1.Width; //图像宽度
int iHeight = this.pictureBox1.Height; //图像高度
Graphics g = this.pictureBox2.CreateGraphics(); //创建Graphics对象实例
g.Clear(Color.White); //初始为白色
for (int x = 0; x <= iWidth / 2; x++) //扩展图像
{
Rectangle DestRect = new Rectangle(iWidth / 2 - x, iHeight / 2 - x, 2*x,2* x);
Rectangle SrcRect = new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height);
g.DrawImage(pictureBox1.Image, DestRect, SrcRect, GraphicsUnit.Pixel);
System.Threading.Thread.Sleep(10);//图片显示速度
}
}
想在pictureBox2中将picture1中图片以由里到外扩展方式显示出来,但是显示出来的图片只是picturebox1中的一部分,怎么完整的显示出来?
你想做的是什么?里到外扩展方式显示是什么意思?