1

我正在尝试显示已编码的图像。它看起来像这样:

"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOQAAAA3CAYAAAAc\/eYMAAAAuUlEQVR4nO3TMQEAMAyAsPo33Z6TMI5EAQ+zQMb8DgAeQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQclyE3fsX77n0AAAAASUVORK5CYII="}

我努力了:

base64-decode()

对于没有该部分的此字符串:

data:image\/png;base64,

但没有结果。

我应该如何转换图像以显示它?谢谢。

编辑:这张图片实际上是签名。我正在使用 jquery 签名板。它在数据库中看起来像这样:

name":"My Name","output":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOQAAAA3CAYAAAAc\/eYMAAAAuUlEQVR4nO3TMQEAMAyAsPo33Z6TMI5EAQ+zQMb8DgAeQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQclyE3fsX77n0AAAAASUVORK5CYII="

如何显示此签名?

4

1 回答 1

0

刚刚在 img 标签中经过编码图像(将 /\ 替换为 /):

<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAOQAAAA3CAYAAAAc/eYMAAAAuUlEQVR4nO3TMQEAMAyAsPo33Z6TMI5EAQ+zQMb8DgAeQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQYEkIMCSGGhBBDQoghIcSQEGJICDEkhBgSQgwJIYaEEENCiCEhxJAQYkgIMSSEGBJCDAkhhoQQQ0KIISHEkBBiSAgxJIQclyE3fsX77n0AAAAASUVORK5CYII=">

提琴手

于 2016-05-19T16:47:10.277 回答