Base64String을 html에 이미지 올리는 법

<img src="data:image/jpeg;base64, Base64String">


검사를 누르면 옆에 창이 뜸.


Base64String = iVBORw0KGgoAAAANSUhEUgAAACcAAAAPCAYAAABnXNZuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAETSURBVEhLzZTJEYMwDEWpI33RAZXQAU1wpA0udMGJIrBiazHygpMMBPgzmgHZFs/6Sip4sE6BM30Da/WCdeTESSrDzQN9tF84kRfBNWBmTpykMtzYfQX3LzHcRBAYHRib8Vb5oM6Ylp97BrdWhrZyrdqu124vh76gXBrDnsV9aect3AIGFwkKi7cTPuU6R3Aq9uD8x6L6MiryDXlXcFJPwaXkRTidy3Zu4MvKGaof7iXpdS2yNWizOrgLFxb6CS53vggn8pBswSVwqXPKVlvMF/owH1ZH4fyF47mOajpR5/xQppuo8JY/DOfeZb/sw3X5QW4Kbb1F7Ja6jOh6OOeSGpPcXIvugRNLJeTfIdIDbN0TwBt5jyf1391P+gAAAABJRU5ErkJggg==


Gif도 됨.


스타일 조절 해주면 크기 조절 가능

<img style="display:block;width:100px;height:100px;" src="data:image/jpeg;base64, Base64String">


C# 이미지를 스트링으로 변환후 다시 이미지로 변환(ImageToString & StringToImage)

반응형