Display Byte Array as an image in html5 canvas
I have converted a string(raw) file to a Byte array , But im unable to bind that byte array as an image into the canvas html5. .
please help me out. .
Does it have to be a canvas object?
If you use base64 encoding you can place an image directly onto the page via CSS or HTML.
These two links will help.
A very good question to ask. A canvas will give you a API for drawing, manipulating, and extracting image data -- useful for a drawing widget. But, displaying an image using a data URI is much more efficient.
Originally Posted by Cornflake
thnkx for ur replies
But ill clear what im actually doing . I hav a string file which contains an image,
i have to display that image.(its an unsigned 8bit 512*512 image)
i have converted the string file to a unsigned byte(8bit) array,and then byte array to image is not happening because i dont know the pixel data logic.
its not an image data its a part of it ,likewise images i have to display
var pixel_data=[255 216 255 224 0 16 74 70 73 70 0 1 1 1 0 72 0 72 0 0 255 254 0 41 73 110 116 101 108 40 82 41 32 74 80 69 71 32 76 105 98 114 97 114 121 .. . . . . . . .]
how should i do???
pls help me out ..
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)