drawing pictures

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WindAndWaves

    drawing pictures

    Hi Folks

    Is it possible to draw pictures with Javascript? I would like to draw a
    poly something (i.e. a shape with coordinates). It is for a mouse-over
    effect to highlight certain areas on a map.

    TIA

    - Nicolaas


  • Richard Cornford

    #2
    Re: drawing pictures

    WindAndWaves wrote:[color=blue]
    > Hi Folks[/color]

    Does that mean that it has finally occurred to you that Indian mystics
    are maybe not the best people to be addressing javascript questions to?
    [color=blue]
    > Is it possible to draw pictures with Javascript?[/color]

    Yes (in the sense that various host provide scriptable facilities that
    will allow the drawing of pictures. For example, PhotoShop (from version
    7) can be scripted with ECMAScript, but SVG UAs and plugins are also
    often scriptable).
    [color=blue]
    > I would like to draw a poly something (i.e. a shape with
    > coordinates). It is for a mouse-over effect to highlight
    > certain areas on a map.[/color]

    So you are probably talking about an HTML UA context, where drawing
    polly shapes may be a matter of creating and positioning hundreds
    (potentially thousands) of CSS positioned DIV elements. That can be done
    but don't expect the results to be quick (or the required code to be
    small and simple).

    You might like to take a look at the JS vector graphics library at:-

    <URL; http://www.walterzorn.com >

    Richard.


    Comment

    • Evertjan.

      #3
      Re: drawing pictures

      WindAndWaves wrote on 21 dec 2004 in comp.lang.javas cript:[color=blue]
      > Is it possible to draw pictures with Javascript? I would like to draw a
      > poly something (i.e. a shape with coordinates). It is for a mouse-over
      > effect to highlight certain areas on a map.[/color]

      <http://groups-
      beta.google.com/group/comp.lang.java. javascript/msg/c446f7216156869 8>

      <http://devrijehuisarts .org/test/jsgraph.asp>




      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      • Dr John Stockton

        #4
        Re: drawing pictures

        JRS: In article <cqabed$k31$1$8 302bc10@news.de mon.co.uk>, dated Tue, 21
        Dec 2004 23:26:03, seen in news:comp.lang. javascript, Richard Cornford
        <Richard@litote s.demon.co.uk> posted :[color=blue]
        >
        >So you are probably talking about an HTML UA context, where drawing
        >polly shapes may be a matter of creating and positioning hundreds
        >(potentially thousands) of CSS positioned DIV elements. That can be done
        >but don't expect the results to be quick (or the required code to be
        >small and simple).[/color]


        Let there be created, preferably in the public domain, images of
        squares. Let there be sets of squares, of side 16 32 64 128 256 pixels.
        Let each set consist of the 256 squares with all combinations of "radii"
        on and off. Let a radius be a 1px-wide black line from the centre to a
        corner or side mid-point of a white square.

        Name them with computable names including the size and a binary encoding
        of the radii used.

        ISTM that quite a lot of diagramming could be done by filling a
        borderless, etc., Table with such images. A preliminary test indicates
        so, except that it might be better to use sides of 2^n+1 or 2^n-1, to
        help diagonals. have the same visual weight as other lines.

        Those figures would tend to get cached. Special figures could be used
        for particular parts of diagrams. When the diagram was hand-coded,
        colspan rowspan and image height/width control might help.

        It would not be the equivalent of proper graphics, but it should compete
        with ASCII art for line diagrams. It could be output by program from a
        diagram in some other form.

        --
        © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
        Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.
        I find MiniTrue useful for viewing/searching/altering files, at a DOS prompt;
        free, DOS/Win/UNIX, <URL:http://www.idiotsdelig ht.net/minitrue/> Update hope?

        Comment

        • Jim Ley

          #5
          Re: drawing pictures

          On Tue, 21 Dec 2004 23:26:03 -0000, "Richard Cornford"
          <Richard@litote s.demon.co.uk> wrote:
          [color=blue]
          >Yes (in the sense that various host provide scriptable facilities that
          >will allow the drawing of pictures. For example, PhotoShop (from version
          >7) can be scripted with ECMAScript, but SVG UAs and plugins are also
          >often scriptable).[/color]

          SVG is probably a good choice for the OP. There's already plenty of
          examples that do it. off the top of my head www.onemag.org does it,
          but so do lots of others.

          Jim.

          Comment

          Working...