0

Is there a way in javascript for binary file manipulation like C. I'm in a critical situation to create an fliped image. I don't have support for css, canvas, HTML, DOM. But I have to do that with only using javascript. If it allows me to load an image into a byte array I can parse each byte and will create a new image. Is there really a way.....?!

thanks in advance

2
  • JavaScript in a browser? How can you not have access to CSS if you have access to JavaScript? Commented Mar 8, 2012 at 6:30
  • 1
    Actually not in browser. I'm trying in Yahoo! widget. And I'm new to that. So I'm not sure it supports css (actually it supports some styles. but not transform, image-orientation, etc), DOM, canvas. Commented Mar 8, 2012 at 6:33

2 Answers 2

1

If it's Yahoo! Widgets it's a different issue. The Canvas class allows you to load an image using 'drawImage()', then you can use scale with negative values to flip the image. See the reference manual at Canvas for more information.

Sign up to request clarification or add additional context in comments.

6 Comments

can you please elaborate a little bit. Actually I don't have access to the yahoo widget website (URLs having yahoo in them are blocked). And I have only documents 1.Widget_Creation_Tutorial_1.1 2.YWE_TV_Widget_Developer 3.YWE_TV_Widget_KONtx 4.YWE_TV_Widget_QuickStart 5.YWE_TV_Widget_Install 6.YWE_TV_Widget_Media_Player In those documents I can't found what you have mentioned. Can you please help me in this case.
Hmm... you need to download the documentation or else you won't be able to do much with Yahoo! Widgets. Maybe download it from a different computer or search for it on Google. It's called something like "Konfabulator 4.5 1113 - edit.pdf"
One more thing. We are not developing for Windows or MAC. We are working for TV widgets. Whether the Canvas thing is possible for us?
For Canvas, you can have a look at Firefox's documentation. I believe the API is the same - developer.mozilla.org/en/Drawing_Graphics_with_Canvas
Thanks a lot for your help friend. Whatever you told was for Windows widget. But I'm working in TV widgets.
|
1
var xhr = new XMLHttpRequest;
xhr.open("GET", "/images/someing.png", true);
xhr.responseType = "arraybuffer";
xhr.onload = function () {
    var data;
    data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
};

This won't work in the current version of IE, so I'm not sure how a widget would handle it. This allows you to read a png into a byte array though.

1 Comment

That even not supports XMLHttpRequest. And we dropped that work. So currently I am not interested in it. If possible somebody close this post or tell me how to close it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.