1 2 3 4 5 6 7 8 9 |
string txt = @"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAAARCAMAAAArMfRlAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACZFBMVEX////61s/+9vTxkn7wiHP5zsXtblX4yb/sZkv++Pftb1b4y8H74NrueGD+9/XyloTxjXn4y8LvhG7//v7+9fP619D2uKz86uf1saTtcVjsalDqXUDsak/qWz/98vD0qpvrYETvgGrvg23vgWvqWj3ud1/1r6H1sqT629T5z8frZEn3w7n++vrsbVT7497//v3vgWv50Mf4xrz2t6vqWz74ysH73dfrYUX2u6/3vrP1rZ/saU7ufWb1sKLsZ0zwinXvf2jtb1XrYkb1s6btcFf//PvueGHznYzsbVP4xbvynYvqXUHuemPvhW/97+z749785uHufGX85N/73df62NH50MjrX0P3wLTvgmz2ua362NHtcln61c7rX0L85uL51Mz//PzqXD/zoZH+9PL98e74ycDsbFLrYEX2t6rvgGnufGXtdVzudl72uq7ymYfxkn/wh3HzpJTrZkvvg27xlYLxkH3wiXX86ub85eH97ur98/HsaE7udl7rY0jsaE32uq73vLHymoj//f397er5zcTzn4797+3tcVj508vsa1L4yL72vLD0qpv+9/b3w7jwhnHrZEjuemL0qJn86OTzno32taj3vrL74dv739n739rqXkLsa1H+8/H3wrf73tj2tajrZUr4zMPue2Txk4D3wLXwjHj++ff0pZX50sr3wrf3wbbtc1v1saPzpJTtdV3wh3LwhXDzopL/+/ryl4X2tqn74dzvfmjxjnvueWL1r6H1s6Xxj3v86OT++vn4x7398O75zcT1tKf3v7T86eXwjHj0q5z0ppbwi3f97uv85ODtdFv4xLry8julAAAAAWJLR0QAiAUdSAAAA41JREFUSMfVlPtbTEEYx9+2Op1yqLRa02XjNCnataxuK2pbhYguIqRsRCKEdS1JS5RyTyQUIRa5leu63/1TZs6Zczbxk/U8Ht8f5jvv2dl5P+eddw7Afy8fzd/by9ePyVcK/Tky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Q9QOnhO0Euy9VSAAAAABJRU5ErkJggg=="; var tmpArr = txt.Split(','); byte[] bytes = Convert.FromBase64String(tmpArr[1]); using (MemoryStream ms = new MemoryStream(bytes)) { ms.Write(bytes, 0, bytes.Length); var img = Image.FromStream(ms, true); img.Save("demo.png"); } |
摘自:http://www.itnose.net/detail/6387947.html