图片保存和一维数组转二维保存到文件

// byte[] rawdataBytes = _ir.RawDataList[0].ToByteArray();
// MemoryStream ms = new MemoryStream(rawdataBytes);
// System.Drawing.Image _Image = System.Drawing.Image.FromStream(ms);
// _Image.Save(System.Environment.CurrentDirectory + "\\热图.jpg");

//float[] rawdatafloat = new float[384 * 288];
//byte[] rawdataBytes = _ir.RawDataList[1].ToByteArray();
//FileStream file = new FileStream(System.Environment.CurrentDirectory + "\\热.csv", FileMode.Create, FileAccess.Write);
//StreamWriter sw = new StreamWriter(file, System.Text.Encoding.UTF8);
//string data = "";
//for (int i = 0; i < 384 * 288; i++)
//{
// rawdatafloat[i] = BitConverter.ToSingle(rawdataBytes, i * 4);
// if (i % 384 == (384 - 1))
// {
// data += rawdatafloat[i].ToString();
// sw.WriteLine(data);
// data = "";
// }
// else
// {
// data += rawdatafloat[i].ToString();
// data += ",";
// }
//}
//sw.Close();
//file.Close();

转载于:https://www.cnblogs.com/pengde/p/10151473.html

你可能感兴趣的:(图片保存和一维数组转二维保存到文件)