用c#.net实现字节流转换为图片,图片转换为字节流,以及根据图片的路径返回字节流,有需要的朋友,可以参考下。
 
复制代码代码示例:
/// <returns>返回的字节流</returns>
privatestaticbyte[] getImageByte(stringimagePath)
{
FileStream files = newFileStream(imagePath, FileMode.Open);
byte[] imgByte = newbyte[files.Length];
files.Read(imgByte, 0, imgByte.Length);
files.Close();
returnimgByte;
}
}
}

相关文章:

  • 2021-05-23
  • 2021-12-11
  • 2021-09-19
  • 2022-12-23
  • 2022-01-06
  • 2022-02-13
猜你喜欢
  • 2021-07-14
  • 2021-09-08
相关资源
相似解决方案