Re: displaying binary images
- From: mleaver@xxxxxxx
- Date: 4 Jan 2006 06:16:05 -0800
It is a base64 byte array of the format of a png file. If I write the array to
disk as a png file with that extension, it opens fine in the browser. The
problem is that I do not want to have to save it directly to a disk. I want to
just display it directly to the browser.
In article <1136319064.181782.27910@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
bwucke@xxxxxxxxx says...
>
>
>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 :)
>
.
- References:
- displaying binary images
- From: mleaver
- Re: displaying binary images
- From: bwucke@xxxxxxxxx
- displaying binary images
- Prev by Date: Re: style display:none and printing
- Next by Date: Re: displaying binary images
- Previous by thread: Re: displaying binary images
- Next by thread: Re: displaying binary images
- Index(es):
Relevant Pages
|