标签:style blog color os io ar cti div
如题,直接上JS
var imgData = canvas.toDataURL("image/png"); var data = imgData.substr(22); $.post(‘Gen‘, { ‘data‘: data, ‘remark‘: $(‘remark‘).val() } ,function(success) { $(‘#img1‘).src(‘data:image/jpeg;base64,‘ + success); } );
后台C#
string inputStr = data; byte[] arr = Convert.FromBase64String(inputStr); MemoryStream ms = new MemoryStream(arr); Bitmap bmps = new Bitmap(ms);
然后你要怎么处理都可以了
canvas图片base64编码后,ajax提交到后台,布布扣,bubuko.com
标签:style blog color os io ar cti div
原文地址:http://www.cnblogs.com/billsquall/p/3922096.html