C# 把byte[]輸出為圖片文件
版權聲明:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/HK_JY/article/details/80320381
/// <summary>
/// 將byte[]輸出為圖片
/// </summary>
/// <param name="path">輸出圖片的路徑及名稱</param>
/// <param name="picByte">byte[]數組存放的圖片數據</param>
public void Write(string path,byte[] picByte)
{
FileStream fs = new FileStream(path, FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
//開始寫入
bw.Write(picByte, 0, picByte.Length);
//關閉流
bw.Close();
fs.Close();
}
調用:
string path = @"F:\testpic.jpg";
Write(path,picByte);
---------------------
作者:灬Change
來源:CSDN
原文:https://blog.csdn.net/HK_JY/article/details/80320381
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!
C# 把byte[]輸出為圖片文件