1

In Palm WebOs I need to convert an image into bytes (like byte array in .Net) to pass it as a parameter to a web service, where I can convert back this bytes data to image and save on server. Please help me to convert image into string variable or any other format to send it to the web service using javascript or jquery in palm webos. Thanks,

Pankaj Pareek
  • 579
  • 1
  • 13
  • 33
  • Where does this image come from? Is it from the camera or filesystem, or an image already on your web page (accessed via the DOM), or something else? – Calroth Nov 09 '10 at 21:59

1 Answers1

2

If javascript engine supports canvas elements you can try to use canvas element and getImageData to fetch the pixel data from your image. Then, depending on type of the image you could create the binary representation of this image.

Here is info about canvas element and getImagedata api: http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-getimagedata

nemisj
  • 11,562
  • 2
  • 25
  • 23