8
我能夠不通過下面的代碼檢查文件大小顯示在圖片框圖片:檢查圖像的寬度和高度
private void button3_Click_1(object sender, EventArgs e)
{
try
{
//Getting The Image From The System
OpenFileDialog open = new OpenFileDialog();
open.Filter =
"Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
if (open.ShowDialog() == DialogResult.OK)
{
Bitmap img = new Bitmap(open.FileName);
pictureBox2.Image = img;
}
}
catch (Exception)
{
throw new ApplicationException("Failed loading image");
}
}
我要檢查,例如圖像大小是否在顯示在圖片框中之前是2MB或4MB。我也想檢查圖像的寬度和高度。
但如何在顯示圖片框 – bharathi 2011-05-18 12:19:02
圖像@bharathi讓我先確認你想在內存或大小尺寸在高度和寬度之前檢查大小? – Devjosh 2011-05-18 12:21:06
@Devjosh - 他想要兩個人。 – Oded 2011-05-18 12:21:51