dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Display Byte Array as an image in html5 canvas

  1. #1
    Join Date
    May 2012
    Posts
    8

    Display Byte Array as an image in html5 canvas

    hI,

    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. .

  2. #2
    Join Date
    Jun 2012
    Posts
    2
    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.
    http://davidbcalhoun.com/2011/when-t...nd-when-not-to

    http://www.greywyvern.com/code/php/binary2base64

    C

  3. #3
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Quote Originally Posted by Cornflake View Post
    Does it have to be a canvas object?
    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.

  5. #5
    Join Date
    May 2012
    Posts
    8

    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 ..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles