2017-01-03 194 views

回答

2

下載並檢查:

string image = @"http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg"; 
byte[] imageData = new WebClient().DownloadData(image); 
MemoryStream imgStream = new MemoryStream(imageData); 
Image img = Image.FromStream(imgStream); 

int wSize = img.Width; 
int hSize = img.Height; 
0
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(@"http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg";); 

HttpWebResponse response = (HttpWebResponse)req.GetResponse(); 

Stream stream = response.GetResponseStream(); 

Image img = Image.FromStream(stream); 

stream.Close(); 

MessageBox.Show("Height: " + img.Height + " Width: " + img.Width);