获取一张图片的字节数组及字节数组的合并
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;
}
{
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;
}
相关文章推荐
- a5调试
- 关于在TextView中设置DrawableLeft的问题
- Android自定义View—HorizontalSlideDeleteListView
- mysql 临时表
- Linux内存分配4
- iOS UIImage一个小用法
- win7 64位 php无法加载mysql扩展的问题
- GRE填空题特点
- Javascript 检测键盘按键信息及键码值对应介绍
- URAL 1712. Cipher Grille (模拟)
- C# 打印多页tif
- HP QR Code (php二维码生成类库)
- 股票知识学习1
- 30 Java Programming Tips and Best Practices for Beginners
- 死锁产生的原因及四个必要条件
- GridViewDemo
- Linux网络编程——tcp并发服务器(多线程)
- 设计模式------命令模式
- 第14周-阅读项目2-中文字符以二进制方式存储
- 黑马程序员_单例设计模式