正如标题所说,我不明白为什么图像没有改变大小。任何人都可以看到吗?
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open bitmap or jpeg.";
//dlg.Filter = "jpg files (*.jpg);*.jpg;*.* | bmp files (*.bmp); *.bmp";
if (dlg.ShowDialog() == DialogResult.OK)
{
this.pictureBoxMap1.Image = new Bitmap(dlg.OpenFile());
Image newImage = this.pictureBoxMap1.Image;
pictureBoxMap1.Height = newImage.Height;
pictureBoxMap1.Width = newImage.Width;
}
dlg.Dispose();