本文介绍了将图像绑定到System.drawing.image对象的图像控件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我的网站, 我已将图像以二进制格式保存到数据库中,然后我将其重新转换为比特数组格式,现在我已将其转换为system.drawing。图像格式 现在我想将图像绑定到图像控制中 我该怎么做 b $ b 请建议 提前预付款im MY website ,I have saved image into database in binary format and i retrived it into Bit array format now i have converted it into system.drawing .image formatnow i want to bind that image into image controlhow can i do thatplease advicethanx in advance推荐答案让你的数据库列名:bn_applied_person_photo和数据名称dt,然后 调用方法:Let your database column name: "bn_applied_person_photo" and datatable name dt, thencall the method:BindApplicantImage((byte[])dt.Rows[0]["bn_applied_person_photo"]);private void BindApplicantImage(byte[] applicantImage){ string base64ImageString = ConvertBytesToBase64(applicantImage); ImageControlID.ImageUrl = "data:image/jpg;base64," + base64ImageString; } public string ConvertBytesToBase64(byte[] imageBytes) { return Convert.ToBase64String(imageBytes); } 这篇关于将图像绑定到System.drawing.image对象的图像控件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!