(.NET Compact)the error "Value does not fall within the expected range." can be found in wm 6
public Image GetMap(string url)
{
try
{
WebRequest request = WebRequest.Create(url);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
Bitmap bmp = new Bitmap(dataStream);
dataStream.Close();
response.Close();
return bmp;
}
catch (Exception ex) { throw ex; }
the code is above
when the picture is small, it is right.
but when larger, the error can be found that Value does not fall within the expected range.
it is only found in windows mobile(i run the code in windows forum with the same url,and there is no problem.)
what is wrong?
thanks.