Giving up on VML

Discussion in 'Javascript' started by Aaron Gray, Dec 31, 2006.

  1. Aaron Gray

    Aaron Gray Guest

    Unless someone can show me how to use it I am giving up on VML.

    Problems

    1) I cannot work out how to detect whether it is present.

    I tried some VB IsObject( CreateObject( ...)) but that did not work.

    2) I cannot seem to get it to draw properly

    cannot draw a circle(oval) crossed by a line to two.

    Any help welcome,

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #1
    1. Advertising

  2. Aaron Gray

    VK Guest

    Aaron Gray wrote:
    > Unless someone can show me how to use it I am giving up on VML.
    >
    > Problems
    >
    > 1) I cannot work out how to detect whether it is present.


    You dnt have to - it is presented by default. VML over ActiveX was on
    the testing stage for IE 4, you can happily forget of it. If it's IE -
    then you have native VML support

    > 2) I cannot seem to get it to draw properly
    >
    > cannot draw a circle(oval) crossed by a line to two.


    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns="http://www.w3.org/TR/REC-html40">
    <head>
    <style>
    v\:* {behavior:url(#default#VML);}
    </style>
    </head>
    <body>
    <v:eek:val coordsize="21600,21600" style='width:156pt;height:156pt'>
    </v:eek:val>
    <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
    </v:line>
    </body>
    </html>

    Just place the line yourself wherever you want. Overall I do not
    understand why are you refusing to google for and to read VML and SVG
    references? The things do not have to be found in starvations by
    yourself, just read the manual.
     
    VK, Dec 31, 2006
    #2
    1. Advertising

  3. Aaron Gray

    Aaron Gray Guest

    >> Unless someone can show me how to use it I am giving up on VML.
    >>
    >> Problems
    >>
    >> 1) I cannot work out how to detect whether it is present.

    >
    > You dnt have to - it is presented by default. VML over ActiveX was on
    > the testing stage for IE 4, you can happily forget of it. If it's IE -
    > then you have native VML support


    I have came across a friends machine that does not support it.

    >
    >> 2) I cannot seem to get it to draw properly
    >>
    >> cannot draw a circle(oval) crossed by a line to two.

    >
    > <html xmlns:v="urn:schemas-microsoft-com:vml"
    > xmlns="http://www.w3.org/TR/REC-html40">
    > <head>
    > <style>
    > v\:* {behavior:url(#default#VML);}
    > </style>
    > </head>
    > <body>
    > <v:eek:val coordsize="21600,21600" style='width:156pt;height:156pt'>
    > </v:eek:val>
    > <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
    > </v:line>
    > </body>
    > </html>
    >
    > Just place the line yourself wherever you want.


    AND now in JavaScript ?

    > Overall I do not
    > understand why are you refusing to google for and to read VML and SVG
    > references? The things do not have to be found in starvations by
    > yourself, just read the manual.


    I have read both W3C and MS'es documentation.

    MS seems not to follow W3C documentation AFAICT.

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #3
  4. Aaron Gray

    Aaron Gray Guest

    >> 2) I cannot seem to get it to draw properly
    >>
    >> cannot draw a circle(oval) crossed by a line to two.

    >
    > <html xmlns:v="urn:schemas-microsoft-com:vml"
    > xmlns="http://www.w3.org/TR/REC-html40">
    > <head>
    > <style>
    > v\:* {behavior:url(#default#VML);}
    > </style>
    > </head>
    > <body>
    > <v:eek:val coordsize="21600,21600" style='width:156pt;height:156pt'>
    > </v:eek:val>
    > <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
    > </v:line>
    > </body>
    > </html>


    They appear as separate elements not as one. As if they were in two separate
    DIV's.

    Also why the style rather than the position attribute as in W3C
    documentation ?

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #4
  5. Aaron Gray

    Randy Webb Guest

    Aaron Gray said the following on 12/31/2006 3:57 PM:
    >>> 2) I cannot seem to get it to draw properly
    >>>
    >>> cannot draw a circle(oval) crossed by a line to two.

    >> <html xmlns:v="urn:schemas-microsoft-com:vml"
    >> xmlns="http://www.w3.org/TR/REC-html40">
    >> <head>
    >> <style>
    >> v\:* {behavior:url(#default#VML);}
    >> </style>
    >> </head>
    >> <body>
    >> <v:eek:val coordsize="21600,21600" style='width:156pt;height:156pt'>
    >> </v:eek:val>
    >> <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
    >> </v:line>
    >> </body>
    >> </html>

    >
    > They appear as separate elements not as one.


    Because they *are* two separate elements.

    > As if they were in two separate DIV's.


    span elements maybe, div tags - unless told otherwise - fill an entire line.

    Use CSS to "stack" them:

    <v:eek:val coordsize="21600,21600"
    style='width:156pt;height:156pt;position:absolute;top:0px;left:0px'>
    </v:eek:val>
    <v:line style="position:absolute;top:0px;left:0px"
    coordsize="21600,21600" from="0pt,0pt" to="156pt,156pt">
    </v:line>

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Dec 31, 2006
    #5
  6. Aaron Gray

    Aaron Gray Guest

    >> They appear as separate elements not as one.
    >
    > Because they *are* two separate elements.
    >
    >> As if they were in two separate DIV's.

    >
    > span elements maybe, div tags - unless told otherwise - fill an entire
    > line.
    >
    > Use CSS to "stack" them:
    >
    > <v:eek:val coordsize="21600,21600"
    > style='width:156pt;height:156pt;position:absolute;top:0px;left:0px'>
    > </v:eek:val>
    > <v:line style="position:absolute;top:0px;left:0px"
    > coordsize="21600,21600" from="0pt,0pt" to="156pt,156pt">
    > </v:line>


    Thats crazy if you look at the W3C spec.

    And how do you put them in a <group> element without them disappearing ?

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #6
  7. Aaron Gray

    Aaron Gray Guest

    I just cannot seem to get the following to work :-

    <html xmlns:vml="urn:schemas-microsoft-com:vml">
    <head>
    <style>
    vml\:* { behavior: url(#default#VML) }
    </style>
    </head>
    <body>

    <vml:group coordsize="1000,1000" coordorigin="0, 0">
    <vml:eek:val style="width:500; height:500" position="500, 500" size="450,
    450" />
    <vml:line from="0, 0" to="500, 500" />
    </vml:group>

    </body>
    </html>

    Totally stumped...

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #7
  8. Aaron Gray

    Aaron Gray Guest

    > And how do you put them in a <group> element without them disappearing ?

    Okay add a 'style' statement. This is horrible !

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #8
  9. Aaron Gray

    RobG Guest

    Aaron Gray wrote:
    > Unless someone can show me how to use it I am giving up on VML.
    >
    > Problems
    >
    > 1) I cannot work out how to detect whether it is present. :)


    If the browser isn't IE 5+, it's not present.


    > I tried some VB IsObject( CreateObject( ...)) but that did not work.
    >
    > 2) I cannot seem to get it to draw properly
    >
    > cannot draw a circle(oval) crossed by a line to two.
    >
    > Any help welcome,


    Why are you pursuing VML? It is a proprietary IE technology that is
    not well supported (if at all) in other browsers. It will likely be
    more useful to get into SVG or maybe XAML, try this post from Laurent
    Bugnion:

    <URL:
    http://groups.google.com.au/group/c...4?lnk=gst&q=SVG&rnum=5&hl=en#14d8b317f3896154
    >


    The canvas element:
    <URL: http://www.whatwg.org/specs/web-apps/current-work/#canvas >

    Check out this article which discusses implementing SVG in IE using
    VML:
    <URL: http://me.eae.net/archive/2005/12/29/canvas-in-ie/ >

    The Mozilla canvas tutorial:
    <URL: http://developer.mozilla.org/en/docs/Canvas_tutorial >

    Regarding vector drawing in browsers:
    <URL: http://wiki.svg.org/Vector_Format_Comparisons >


    --
    Rob
     
    RobG, Dec 31, 2006
    #9
  10. Aaron Gray

    VK Guest

    > > You dnt have to - it is presented by default. VML over ActiveX was on
    > > the testing stage for IE 4, you can happily forget of it. If it's IE -
    > > then you have native VML support

    >
    > I have came across a friends machine that does not support it.
    >


    Tell your friend to reinstall immediately - the machine is badly broken
    or (s)he's using very obsolete IE version wide open for all
    vulnerabilities found in IE over the last 6 years.

    > > <html xmlns:v="urn:schemas-microsoft-com:vml"
    > > xmlns="http://www.w3.org/TR/REC-html40">
    > > <head>
    > > <style>
    > > v\:* {behavior:url(#default#VML);}
    > > </style>
    > > </head>
    > > <body>
    > > <v:eek:val coordsize="21600,21600" style='width:156pt;height:156pt'>
    > > </v:eek:val>
    > > <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
    > > </v:line>
    > > </body>
    > > </html>
    > >
    > > Just place the line yourself wherever you want.

    >
    > AND now in JavaScript ?


    Think! Learn! Then think again! ;-) :-|

    SVL is not Prototype/Scriptaculous crap linking: you have to _think_
    and be ready to work over differences in SVG and VML. It also presume a
    good understanding of the involved entities: finit viewport, infinit
    Descartes space, their relations, geometrical shape vs. physical body.
    Briefly if you wanted to surprise your girl by the next week-end you've
    chosen a wrong matter to deal with ;-) :-|

    As an inside info: VML is noticeable more powerful and _much_ more easy
    to script than SVG. You cannot do it with VML - you have little chances
    with SVG.

    <http://www.dynamicdrive.com/dynamicindex11/editor.htm> is not an ideal
    sample to copy - not at all, it is just a proof of concept that behind
    the knowledge you'll obtain the things will be much more easy than they
    are right now.
     
    VK, Dec 31, 2006
    #10
  11. Aaron Gray

    Aaron Gray Guest

    > As an inside info: VML is noticeable more powerful and _much_ more easy
    > to script than SVG. You cannot do it with VML - you have little chances
    > with SVG.


    I did my SVG example in about 1/2 an hour.

    SVG is much much nice that VML particularly MS'es VML.

    Anyway I am getting there but there are so many oddities, styles used
    instead of attributes in the MS version which is just horrible.

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #11
  12. Aaron Gray

    Aaron Gray Guest

    > Anyway I am getting there but there are so many oddities, styles used
    > instead of attributes in the MS version which is just horrible.


    opacity and fill=false do not seem to work I cannot seem to get a see
    through oval.

    <html xmlns:v="urn:schemas-microsoft-com:vml"
    xmlns="http://www.w3.org/TR/REC-html40">
    <head>
    <style>
    v\:* {behavior:url(#default#VML);}
    </style>
    </head>
    <body>
    <v:group style='width: 100%; height:100%'>
    <v:line from="0, 0" to="1000, 1000" stroke='true' strokecolor='black'
    strokeweight='2px'>
    </v:line>
    <v:eek:val opacity="1.0" fill="false"
    style='top:50;left:50;width:900;height:900'>
    </v:eek:val>
    </v:group>

    </body>
    </html>

    moan, moan, moan, happy new year, hackers, ...

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #12
  13. Aaron Gray

    Aaron Gray Guest

    > Unless someone can show me how to use it I am giving up on VML.
    >
    > Problems
    >
    > 1) I cannot work out how to detect whether it is present.
    >
    > I tried some VB IsObject( CreateObject( ...)) but that did not
    > work.


    Still none the wiser as to why that did not work.

    > 2) I cannot seem to get it to draw properly
    >
    > cannot draw a circle(oval) crossed by a line to two.


    Here's where I am with a JavaScripted DOM version :-

    http://www.aarongray.org/Test/VML/VML-DOM.html

    Again still non the wiser as to why the line will not display and as to why
    I cannot get transparent circles ?

    Many thanks if you can help, dont be bothered if you cannot,

    Aaron
     
    Aaron Gray, Dec 31, 2006
    #13
  14. Aaron Gray

    Aaron Gray Guest

    > Here's where I am with a JavaScripted DOM version :-
    >
    > http://www.aarongray.org/Test/VML/VML-DOM.html


    Okay lines working now. 'toString()' does not convert numbers to numeric
    strings !

    I still cannot get transparent circles ? Even with 'fill=false' and
    'opacity=0' !

    Any help welcome,

    Aaron
     
    Aaron Gray, Jan 1, 2007
    #14
  15. Aaron Gray

    Aaron Gray Guest

    >'toString()' does not convert numbers to numeric strings !

    Especially if I pass the input as a paramenter rather than as the object,
    he, he, Arg.

    Aaron
     
    Aaron Gray, Jan 1, 2007
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason

    VML Anti-aliasing woes

    Jason, Sep 26, 2003, in forum: XML
    Replies:
    0
    Views:
    776
    Jason
    Sep 26, 2003
  2. Prashant

    XML and VML Job

    Prashant, Jan 9, 2004, in forum: XML
    Replies:
    0
    Views:
    410
    Prashant
    Jan 9, 2004
  3. Macroman

    VML - Help

    Macroman, Feb 16, 2004, in forum: XML
    Replies:
    0
    Views:
    410
    Macroman
    Feb 16, 2004
  4. sixteenmillion

    The giving that keeps on giving

    sixteenmillion, Nov 19, 2007, in forum: C Programming
    Replies:
    0
    Views:
    455
    sixteenmillion
    Nov 19, 2007
  5. Walton
    Replies:
    0
    Views:
    659
    Walton
    Feb 15, 2008
Loading...

Share This Page