Re: Binary I/O in Javascript
- From: "Kevin" <kdarling@xxxxxxxxx>
- Date: 15 Nov 2005 20:58:25 -0800
Patient Guy wrote:
> "Kevin" <kdarling@xxxxxxxxx> wrote in
> news:1132016381.092324.47860@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
>
> > Patient Guy wrote:
> >> I am writing client-side code that will generate binary data for
> >> producing a GIF file through an OBJECT element. (The GIF is an image
> >> of a line and points on a two-axis plot.)
> >
> > I'd like to help, but why do you need to pass binary data to a plot
> > object?
>
> [...]
> 2. The alternative is to use script to manipulate data to create a
> properly formatted image file to render the plot. The appearance is
> stunningly much better. The GIF is the most suitable form for images that
> are not photographs (as a plot is). An OBJECT element is created
> dynamically, its 'type' attribute set (='image/gif') and its 'data'
> attribute then set with encoded binary (the encoding is likely to be
Ah. I had misread your first posting, thinking you already had written
an ActiveX display or plotting object. So I couldn't figure out why
you wouldn't simply pass the plot parameters as text or numbers to that
object for display generation.
For example, I did an ActiveX signature control that is used for both
capture and display. You get and set compressed vector data (as a
string) to draw lines or whatever.
But you can't just create an HTML element of type OBJECT and expect it
to know how to display (or do) anything. So if your idea was to
create GIF data and pass it to an inanimate element of type OBJECT,
nothing would happen. Unless there's some magic OBJECT I don't know
about.
> [...]
> But I want to do some testing with file I/O, and the file I/O library
> functions for the most-used browsers I know of (the ActiveX
> FileSystemObject, Mozilla/Firefox XPCOM/XPConnect) have read() and write()
> functions that only seem to work with String objects, [...]
This is what I thought your original Q was about... reading in binary
test data to pass to an ActiveX object. For that, you could use
XMLHTTP to read in a file://, and pass its responseBody as binary data
into a control.
> The suggestion to use vector graphics (SVG, a W3C "recommendation") is
> probably the way I should go, although clearly (not all) the major
I like SVG myself, and have done some complicated, rotating and moving
gizmos under it. Google around and you should be able to find sample
SVG code for plotting graphs... a very popular use for SVG.
If it's just simple graphing, though, you could get away with using
DIVs / tables and CSS to create some nice images. Bar graphs easiest,
of course, but the finer grain you go, the more it'd look like a line,
too.
Luck!
Kevin
.
- References:
- Binary I/O in Javascript
- From: Patient Guy
- Re: Binary I/O in Javascript
- From: Kevin
- Re: Binary I/O in Javascript
- From: Patient Guy
- Binary I/O in Javascript
- Prev by Date: Re: DHTML MENU problem in IE
- Next by Date: What is the best summary of browser DOM support?
- Previous by thread: Re: Binary I/O in Javascript
- Next by thread: Form validation problem
- Index(es):
Relevant Pages
|