我碰到一个很奇怪的问题,同一个Stream,我在windowmobile下,通过new Bitmap(Stream)的方式能成功转成图片,在winform下用同样的方法却老是报参数无效的错误。各位高手帮忙分析下是什么问题,谢谢
逐行debug,看看代码有问题没######
{
string values = "0,0,44,22,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,248,15,3,240,63,240,251,255,125,247,223,240,251,255,125,247,223,240,251,255,125,247,223,240,248,15,125,247,223,240,251,255,3,240,63,240,251,255,119,247,127,240,251,255,123,247,191,240,251,255,123,247,191,240,248,15,125,247,223,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240,255,255,255,255,255,240";
string[] vs = values.Split(',');
List<byte> byteList = new List<byte>();
foreach (string value in vs)
{
int i = Convert.ToInt16(value);
byteList.Add((byte)i);
}
Stream memoryStream = new MemoryStream(byteList.ToArray());
Bitmap bmap = new Bitmap(memoryStream);
memoryStream.Close();
return bmap;
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。