Crear imagen a partir del valor ascii
Frecuentes
Visto 1,816 equipos
0
Soy nuevo base64 images. I have a problem that base64 images are not completely supported in IE8
or lower, with a limitation of 32Kb
.
Finally, I got a function to convert base64
imágenes a ascii
código usando javascript
. However, I am not able to figure out how to show a img
usar ascii
value of the image.
cuando usamos base64
in img
tag we write like this,
<img src="data:image/png;base64,iVBORw0K..." />
Therefore, I need something using which if I have an ascii
code of an image, I can display it the similar way I am displaying base64
image image.
1 Respuestas
0
I think you misunderstand the limitations of IE8.
IE8 only supports images with a maximum size of 32KB, not 32 bits. The only thing you can do about it is delivering images that are at most 32KB big. Or drop the support for IE8 is that is an option.
In answer of your second question:
set the src attribute of the image using JavaScript:
function changeImage(dataAsBase64String)
{
image1.src = 'data:image/png;base64,' + dataAsBase64String;
}
Respondido 12 Feb 14, 09:02
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript html image base64 ascii or haz tu propia pregunta.
What do you mean by saying 'ascii code of an image'? - Patrick Hofman
@PatrickHofman: it is the same text which you will see it you open a
.jpg
or.png
or any other image file in notepad - Veer ShrivastavStill your question is unclear. Do you mean you need the string representation in base64 of your image bytes? - Patrick Hofman
no, I have the ascii value of the image, I need to show it on HTML page.
<img src="test.jpg" />
src
I need to give the ascii value of the image. - Veer Shrivastav