(.NET Compact)the error "Value does not fall within the expected range." can be found in wm 6

edwin110 2009-03-12 09:29:05
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.
...全文
96 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
starsword 2009-03-12
  • 打赏
  • 举报
回复
Bitmap 似乎不能超过大概40M,是不是你的picture太大了?

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧