您的位置:首页 > 其它

获取一张图片的字节数组及字节数组的合并

2015-06-15 15:30 204 查看
public Byte[] Tupian() 获取一张图片的字节数组
{
FileStream fs = new FileStream(@"G:\smartrt\bin\Debug\Data\tpl\111.jpg", FileMode.Open);
int filelength = 0;
filelength=(int) fs.Length; //获得文件长度
Byte[] fl = new Byte[filelength]; //建立一个字节数组
fs.Read(fl, 0, filelength); //按字节流读取
fs.Close();
return fl;
}
public static byte[] copybyte(byte[] a, byte[] b)字节数组的合并
{
byte[] c = new byte[a.Length + b.Length];
a.CopyTo(c, 0);
b.CopyTo(c, a.Length);
return c;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: