前端js把图片转换成base64位的后端(C#)怎么转成image保存

前端js把图片转换成base64位的后端(C#)怎么转成image保存,第1张

string base64Str = "的BASE64字符串";
byte[] bytes = SystemConvertFromBase64String(base64Str);
using (SystemIOMemoryStream ms = new SystemIOMemoryStream(bytes))
{
    return SystemDrawingImageFromStream(ms);
}

try{
BufferedImage image=ImageIOread(new File("E:\\evidence\\DSCF0030_postJPG"));
}catch (IOException e){
eprintStackTrace();
}
====
这样就可以从磁盘文件读成Image。 BufferedImage是Image的子类,更好用


欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/yw/13337893.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2025-08-31
下一篇2025-08-31

发表评论

登录后才能评论

评论列表(0条)

    保存