Visualizzazione dei risultati da 1 a 8 su 8

Discussione: svg

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    3

    svg

    Ho la necessità di utilizzare un un svg al quale devo passare dei dati dinamicamente; se creo un .svg e lo richiamo da una pagina html funziona correttamente (ma non so come fare a renderlo dinamico), mentre se il medesimo codice lo creo come nell'esempio qui sotto mi 'stampa' solo il testo mentre non mi fa vedere l'immagine

    ------------------------------------------------------
    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <% Response.ContentType = "image/svg-xml" %>
    <html>
    <head>
    <title>Documento senza titolo</title>
    </head>

    <body>

    <% var x = 150;
    var y = 350;

    Response.Write('<svg x="400px" y="300px" width="640" height="480" version="1.1">');
    Response.Write('<text x="10" y="100" style="fill:red;font-family:times;font-size:18">esempio di SVG</text>
    ');
    Response.Write('<image id="background" width="640px" height="480px" xlink:href="../image/italia_ta.png"/>');
    Response.Write('<circle cx="');
    Response.Write(x);
    Response.Write('" cy="');
    Response.Write(y);
    Response.Write('" r="500" style="stroke:red;fill:red"/>');
    Response.Write('</svg>');
    %>
    </body>
    </html>
    -----------------------------------------

    idee?

  2. #2
    allora hai 2 possibilità con asp.

    la prima è di mettere l'estensione .asp al file in modo da farlo passare per il parser ma purtroppo in quel modo non tutti i plugin te lo leggeranno in modo corretto.

    la seconda è quella di inserire nel webserver (iis) l'estensione svg assegnata alle pagine asp.

    Luca Mascaro
    Usability e Accessibility Engineer, User Interface Designer/Engineer
    NOW BLOG
    W3C HTML & WCAG WG Member for IWA/HWG

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    3
    ho aggiunto l'estensione .svg nell'iis con percorso eseguibile C:\WINNT\system32\inetsrv\asp.dll ma niente da fare

    allora ho provato a creare una pagina html che richiamasse una .asp (con all'interno svg) ma niente di nuovo.. includo il codice


    ********* mio.html ***************

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Documento senza titolo</title>
    <meta http-equiv="Content-Type" content="image/svg-xml; charset=iso-8859-1">
    </head>

    <body>

    <table height="480" width="640" align="center">
    <tr><td><div align="center" class="Stile1">::::Prova SVG::::</div></td>
    </tr>
    <tr>
    <td><object data="miosvg.asp?x=100&y=400" type="image/xml+svg" width="640" height="480">
    <embed src="miosvg.asp?x=100&y=400" type="image/xml+svg" width="640" height="480"/>
    </object></td>
    </tr>
    </table>
    </body>
    </html>


    ********* miosvg.asp ***************

    <svg x="100px" y="100px" width="640" height="480" version="1.1">
    <image id="background" width="640px" height="480px" xlink:href="../image/italia_ta.png"/>
    <text x="10" y="100" style="fill:red;font-family:times;font-size:18">Primo esempio di SVG</text>
    <circle cx=<%=Request.QueryString('x')%> cy=<%=Request.QueryString('y')%> r=<%=Request.QueryString('y')%> style="stroke:red;fill:red"/>
    </svg>


    molte grazie per l'aiuto

    ps se hai qualche link dove potermi documentare, (ancora meglio in ita) anche w3.org non sono riuscito a trovare niente di esaudiente

  4. #4
    perchè qui il problema non è di svg ma di iis e asp, prova a chiedere nel forum di asp

    ciaooo
    Luca Mascaro
    Usability e Accessibility Engineer, User Interface Designer/Engineer
    NOW BLOG
    W3C HTML & WCAG WG Member for IWA/HWG

  5. #5
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Togli i tag HTML dal primo file... o aggiungi l'istruzione contenttype nel secondo...
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  6. #6
    Utente di HTML.it
    Registrato dal
    Jan 2004
    Messaggi
    3
    grazie, sono riuscito anche se mi sfugge ancora qualche particolare.. perchè se inserisco tag html nella pagina asp non gira più?
    Mi diresti dove trovare qualche documentazione un po' dettagliata perfavore?

    ciao

  7. #7
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Non funziona più perchè anche i tag html vengono spediti al plugin che visualizza l'SVG. Quindi tu invii un file del tipo

    <html>
    <head>
    <titolo>prova</titolo>
    <head>
    <svg x="100px" y="100px" etc...>
    </svg>
    </html>


    che malgrado sia comunque un documento xml ben formattato, ha dei tag che il plugin non riesce a interpretare e quindi non visualizza nulla.
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  8. #8
    Utente di HTML.it
    Registrato dal
    Apr 2004
    Messaggi
    110
    Non capisco a me non funziona
    Questa è la pagina html che richiama l'asp, ho provato a togliere anche il DOCTYPE ma non cambia nulla. L'embed del file svg invece funziona, non è che è il plug-in dell'adobe?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <HTML>
    <head>
    <title>Documento senza titolo</title>
    <meta http-equiv="Content-Type" content="image/svg-xml; charset=iso-8859-1">
    </head>

    <body>

    <table height="480" width="640" align="center">
    <tr>
    <td>
    <div align="center">::::Prova SVG2::::</div>
    </td>
    </tr>
    <tr>
    <td>
    <object data="prova-svg.asp?x=200&y=100" type="image/xml+svg" width="640" height="480">
    <embed src="prova-svg.asp?x=200&y=100" type="image/xml+svg" width="640" height="480"/>
    </object>


    </td>
    </tr>
    </table>
    </body>
    </HTML>


    ----------------------------------------------------------------------
    Questa invece è la pagina asp, ho fatto molti tentativi ma ero partito con una che aveva i tag html come aveva fatto paglioz, tolti fino a diventare questo file svg con parti in asp chiamato prova-svg.asp


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    <%
    Dim x, y

    x = 0
    If (Request.QueryString("x") <> "") Then
    x = cint(Request.QueryString("x"))
    End If
    y = 0
    If (Request.QueryString("y") <> "") Then
    y = cint(Request.QueryString("y"))
    End If
    %>

    <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>

    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">


    <svg width="400" height="200" preserveAspectRatio="xMinYMin">

    <ellipse cx="<%= x %>" cy="<%= y %>" rx="70" ry="30" style="stroke:red;fill:white"/>

    </svg>
    Ciao
    Marco

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.