Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript and PHP - Drawing Lines

    An interesting way of drawing a line interactively without the need for any plug-ins.

    http://www.smokinggun.com/demos/line_draw.php

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    That is pretty neat.

    I suppose there's no way to antialias the lines since I assume you're using PHP to generate a transparent image with an appropriate black line through it?

    BTW, through the use of the SVG namespace, you can draw anti-aliased lines in SVG-enabled builds of Mozilla and Amaya without a plugin.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I didn't mean to give the wrong impression, this is not my script. I couldn't tell you the slightest thing about php. I just thought it deserved a look.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can also draw anti-aliased lines using VML, which is natively supported in IE5+

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by brothercake
    You can also draw anti-aliased lines using VML, which is natively supported in IE5+
    And not supported anywhere else, whereas an excellent plugin exists for SVG for IE and NS4. Which is why I promote SVG over VML (not just because the fact it is in 1.1 W3C Recommendation)

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Indeed ... so surely the best solution is to support both - sniff for vector support and then you get VML for the 80% of internet users whose browser natively supports it, and SVG for those who have the right plug-in, or can be prompted to download it. I would always avoid using a technology that relies on a plug-in wherever possible.

  • #7
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by brothercake
    I would always avoid using a technology that relies on a plug-in wherever possible.
    When I was on Win98, IE6 did not come with VML support, and always prompted me to download a multi-megabyte extension to support it. I avoid those things even more than plugins.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •