怎样使图片以适合窗口大小的大小显示
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Normal;
使用这两句时,当图片小时,没什么问题,但当图片大时,只能显示一部分,请问,怎样改变图片大小使之适合窗口大小,正常显示。
还有就是怎样使缩放无失真
int w = pictureBox1.Image.Width;
int h = pictureBox1.Image.Height;
w = w + 25;
h = h + 20;
NewBitmap = new Bitmap(this.pictureBox1.Image, w, h);
this.pictureBox1.Image = NewBitmap;
int w = pictureBox1.Image.Width;
int h = pictureBox1.Image.Height;
w = w - 25;
h = h - 20;
NewBitmap = new Bitmap(this.pictureBox1.Image, w, h);
this.pictureBox1.Image = NewBitmap ;
这样放大缩小有失真,做几次后就都看不到原图了……请高手们给解决下,谢谢! --------------------编程问答-------------------- PictureBox的sizemode设置为StretchImage
--------------------编程问答-------------------- wuyq11您好,StretchImage 这不是全屏显示吗,那怎样调整图片大小,使之能居中显示呀
补充:.NET技术 , C#