Exporting SVG images?
Posted: Thu Apr 25, 2024 8:12 am
Nowadays we can import SVG images into LiveCode tolerably well, but can we export them in SVG format?
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Web applications are also "just" text.stam wrote: Thu Apr 25, 2024 2:41 pm is SVG not just a text file? (albeit a specially formatted one?)
It would take quite a while for the team to work through their current queue to get to it, so we have time to draft a good actionable spec.dunbarx wrote: Thu Apr 25, 2024 8:21 pm So is this worth an enhancement request, to add a sixth format to the "export" command?
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!-- Created with Spectrib v0.1 -->
<!-- NbSpectres 0 -->
<!-- agrandissement 0 -->
<!-- coorAxeOrig 0 -->
<!-- Reserved -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"Code: Select all
if quelelem is not "" then
put the label of btn "EpLigne" into epLigne
replace "," with "." in epligne
put hauteurDoc-20 into debY
put "75" into debX
put "255,128,128 223,223,0 0,128,0 0,64,128 255,128,64 64,128,128 128,64,64 128,255,0 255,128,255 128,0,255" into line 7 of lescouleurs
put (the number of items in line 1 of sp3)-(the number of items in line 1 of ronin) into nmCoul
repeat with z = 1 to the number of items in line 1 of ronin
put return & "<g id=" & quote & "Atomic-elmt-"& z & quote & " label=" & quote & "Legende_" & item z of line 1 of ronin & quote & " >" after ron --- Puis on ajoute les légendes des spectres
put return & " <line fill=" & quote & "none" & quote & " stroke=" & quote &"rgb(" & item z of line 7 of lescouleurs & ")" & quote & " stroke-width=" & quote & "3" & quote & " x1=" & quote & debX & quote & " y1=" & quote & deby& quote & " x2=" & quote & debX+20 & quote & " y2=" & quote & debY & quote & " opacity=" & quote & "1" & quote & " onclick='MasquerOuPas(evt, " & quote & "Ref_" & item z of line 1 of ronin & quote & "), desactive(evt)' />" after ron ---axe horizontal
put return & " <text transform=" & quote & "matrix(1 0 0 1 " & debX +25 & " " & debY+3 & ")" & quote & " font-family=" & quote & "Arial" & quote & " font-size=" & quote & "6" & quote & " >" & item z of line 1 of ronin &"</text>" after ron
put return & " </g>" after ron
add 100 to debX
end repeatI have a lot of work to do, but I'm tempted by your proposal!
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg height="100%" stroke-miterlimit="10" style="fill-rule:nonzero;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" version="1.1" viewBox="0 0 2000 2000" width="100%" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs/>
<g id="Layer-1">
<path d="<ICONPATH PROPERTY HERE>" fill="#000000" fill-rule="nonzero" opacity="1" stroke="none"/>
</g>
</svg>