Results 1 to 3 of 3

Thread: embedded svg viewer (win32)

  1. #1
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default embedded svg viewer (win32)

    see picture...

    via the link in my sig, you can download an example of an embedded SVG viewer (win32)

    SVG=scalable vector graphics,
    *VECTOR* graphics means that the graphics automatically re-size smoothly to any screen size wthout having to modify the svg file.

    I'm mainly interested in using svg for charts/maps/floorplans etc.

    svg is a text (xml) format so basically you can use notepad to create an svg file. (plenty of resources on the net)

    you need the adobe svg plugin....

    http://www.adobe.com/svg/viewer/install/main.html

    You can either embed the svg viewer plugin in a web page (via an embed/object tag) or directly use the COM object in NR (as I did in my example)

    Currently I've only figured out how to feed the SVG COM object with an external SVG file (from disk or webserver)

    I would like to feed it with a string containing SVG, but this requires various DOM function calls, which I don't think you can use in NR directly ? (I don't want to write a plugin wrapper for the svg viewer if I can help it )

    If you want 'live' fast changeing data in your svg file, then you need to use the DOM to manipulate the SVG tree (for example if you want to change a temperature value or status graphic on the screen without recreating/reloading the whole svg file). Using the COM object in NR as per my example won't allow this. In that case you need to use a web page and javascript to manipulate the DOM...

    Also, the SVG COM object in NR is not transparent (just like NR's embedded web browser isn't )... no idea how to make that happen.... (wmode="transparent" has no effect)

    The two charts svg files in my example were generated by this product
    http://www.sharpplot.com/

    We use this tool extensively in the intranet application that our company sells....


    There are lots of alternative chart/svg generators (including doing the job yourself in lua or notepad)



    Marcel
    Attached Images Attached Images
    Last edited by mhwlng; December 31st, 2006 at 02:05 AM.

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    2,140

    Default

    see svgsample2.zip in my sig.

    This shows an interactive way of using SVG

    (needs 29-dec-2004 version of NR)

    The numbers on the screen are updated in real time by NR.
    And the state of the circuit breakers (click on the green/red squares) gets reported back to NR.

    The SVG file is embedded in a html page.
    The html page contains javascript that uses the new NR COM object to communicate with NR from inside the HTML page.

    something like this is now possible :

    Code:
    var ax = new ActiveXObject('NetRemote.App');
    ax.GenerateAction(-999,7,0,'NetRemote.MessageBox("Test")');
    str=ax.GetVariable('MP.Artist');
    str=ax.DecodeString('{MP.TrackPosition} / {MP.TrackLength}');
    ax.SetVariable('varname','OPEN')
    ax.GoHome('panelname');
    ax.GoDevice('devicename','panelname');
    ax.GoMacro('macroname','panelname');
    I got the sample SVG file from http://www.wpsenergy.com/JayNick

    the best way to create SVG files is with visio or adobe illustrator (or notepad )...

    Marcel
    Attached Images Attached Images

  3. #3
    Join Date
    Nov 2003
    Location
    Hove, E Sussex, UK
    Posts
    4,005

    Default

    Man this is really cool, I would love to be able to do something with this....

    • Aquarium Temps

    • X10 Lights

    • Maybe I buy an alarm and monitor that!


    Ummmm.... Must find reason to use.
    Thx, Dan

    Onwards and Upwards!
    http://www.danward.co.uk

Posting Permissions

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