winform改变上传图片的大小,代码如下
//打开选择文件对话框 OpenFileDialog OFG = new OpenFileDialog(); OFG.ShowDialog(); this.pictureBox1.Image = Image.FromFile(OFG.FileName); Image img = new Bitmap(pictureBox1.Image);
//在这设置你想要的Size 目前设置为 宽800 高1100 Image changeSize = img.GetThumbnailImage(800, 1100, null, new IntPtr()); pictureBox1.Image = changeSize; label5.Text = "图片实际像素值:" + pictureBox1.Image.Width + "×" + pictureBox1.Image.Height;
卖情侣装的网站 淘宝好看的情侣装 www.qinglvs.com