Re: Binary I/O in Javascript



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

.



Relevant Pages

  • Re: HTML safe colors
    ... will be mapped to the nearest supported color. ... combinations of browser/display adapter tried to display the colour by ... 256 colour palette and if there are more than one of them on a page then the ... The first gif would display correctly as each of its colours (well most of ...
    (comp.infosystems.www.authoring.html)
  • Re: Nominating a web page to display GIFs
    ... That blank page is not a real page, it's just the browser displaying your ... I want it to display in the blank web page of my ... | can somehow ceate a hyperlink string for each icon that marries the blank ...
    (microsoft.public.frontpage.programming)
  • Re: How do I display GIF file in a windows dialog?
    ... able to show GIF and animated GIFs on my dialog. ... > Is there any way i can display GIFs? ... http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL ...
    (microsoft.public.win32.programmer.gdi)
  • Re: GIF or JPEG?
    ... But PictureBox can not display an animated GIF, ... Any controls can do this? ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: Image editing/Creating modules
    ... can someone give a name of any image (JPG or GIF) editing / ... which allow to create images to display on ...
    (perl.beginners)