开发者

how to convert image into bytes (like byte array in .Net) using javascript in Palm WebOS

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 t开发者_如何学JAVAo the web service using javascript or jquery in palm webos. Thanks,


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜