0
我想,當我調整的形式,形象展示與窗體大小調整自動更改圖像上形成顯示器的大小調整
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp; *.png";
if(openFileDialog1.ShowDialog() == DialogResult.OK){
pictureBox1.ImageLocation = openFileDialog1.FileName;
//pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage;
}
}
建議我一些代碼,請
= pictureBox1.SizeMode PictureBoxSizeMode.StretchImage; 這段代碼不保持圖像的比例 –
請給我建議一些代碼,改變圖像顯示尺寸並保持比例。像Windows圖片瀏覽器 –
你嘗試使用PictureBoxSizeMode.AutoSize?使用兩個Dock作爲填充和SizeSize作爲AutoSize – Damith