Re: displaying binary images
- From: "bwucke@xxxxxxxxx" <bwucke@xxxxxxxxx>
- Date: 3 Jan 2006 12:11:04 -0800
mleaver@xxxxxxx napisal(a):
> windowHandle.document.write('<img name="myImage" src="javascript:png">');
>
> where png is the variable that contains a base64 binary array representation
Array? well, you need a base64 string. I'm not sure what format your
array is, but I bet changing it into a string shouldn't be too hard.
> of
> the png file that was returned from the server.
>
> What is the correct way to display a base64 image directly?
<img
src="data:image/png;base64,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">
where "XXXXXXXXXXXXXXXX" is the base64-encoded image content.
Of course it will fail in MSIE if the data: URL is longer than 256
chars (and for anything bigger than a few pixels, it will), so better
look for alternate solutions for it (probably there is some ActiveX
control that can do it - Not a 'correct' way but a working one :)
.
- Follow-Ups:
- Re: displaying binary images
- From: mleaver
- Re: displaying binary images
- References:
- displaying binary images
- From: mleaver
- displaying binary images
- Prev by Date: Re: Late window.onload, defer, DOMContentLoaded and multiple source files
- Next by Date: Retrieving Environment Variables
- Previous by thread: Re: displaying binary images
- Next by thread: Re: displaying binary images
- Index(es):
Relevant Pages
|