svg shapes macro adapted for use in a svg annotation overlay for raster 
images (or html/pdf using forreign object underlying object/iframe layer)

[image: svgoverlay.jpg]


\define circleOL(xpos,ypos,radius,fill,border,borderw)
<circle cx=$xpos$ cy=$ypos$ r=$radius$ fill=$fill$ stroke=$border$ 
stroke-width=$borderw$/>
\end
\define squareOL(xpos,ypos,width,fill,border,borderw)
<rect x=$xpos$ y=$ypos$ width=$width$ height=$width$ fill=$fill$ 
stroke=$border$ stroke-width=$borderw$/>
\end
\define rectangleOL(xpos,ypos,width,height,fill,border,borderw)
<rect x=$xpos$ y=$ypos$ width=$width$ height=$height$ fill=$fill$ 
stroke=$border$ stroke-width=$borderw$/>
\end
\define ovalOL(xpos,ypos,width,height,fill,border,borderw)
<ellipse cx="$xpos$" cy=$ypos$ rx=$width$ ry=$height$ fill=$fill$ 
stroke=$border$ stroke-width=$borderw$/>
\end
\define lineOL(xpos,ypos,xpos2,ypos2,linecol,linew)
<line x1=$xpos$ y1=$ypos$ x2=$xpos2$ y2=$ypos2$ stroke=$linecol$ 
stroke-width=$linew$/>
\end
\define textOL(xpos,ypos,fill,text)
<text x="$xpos$" y=$ypos$ fill=$fill$>$text$</text>
\end

SVG SHELL

<svg viewBox="0 0 400 200" width="" height="">
<!-- this is the shell to hold the underlying raster image and overlying 
annotations, viewBox detemines the image size 1st number is starting point 
on x up/down axis 2nd number y right to left axis 3rd number the ending 
point on x axis pixels from starting point 4th number the ending point on y 
axis pixels from starting point-->
<!-- rect eleemnt for background color and svg border can be removed -->
<rect x="0" y="0" width="399" height="199" fill="black" stroke="white" 
stroke-width="2"/>
<!-- 2 text elements below are for illustrative purposes only  can be 
removed -->
<text x="50" y="50" stroke="white" font-size="50px">UNDERLYING</text>
<text x="50" y="150" stroke="white" font-size="50px">RASTER IMAGE</text>
<!-- the underlying raster image(s) jpg's etc multiple can be inserted each 
in its own image tag image tags MUST BE FIRST in listing order -->
<image href="file:///D:/file.jpg" x="0" y="0" width="100%"/>
<!-- overlay annotations the svg overlay shapes macros or normal svg 
elements will go AFTER the image tag(s) holding the raster images jpg's etc 
so the annotations are on top of the raster image(s) -->
<!-- outlined shapes -->
<<circleOL "66" "30" "25" "none" "cyan" "3">>
<<squareOL "114" "10" "50" "none" "orange" "3">>
<<rectangleOL "190" "5" "100" "50" "none" "pink" "3">>
<<ovalOL "310" "35" "50" "25" "none" "white" "3">>
<!-- solid shapes -->
<<circleOL "66" "100" "10" "cyan" "cyan" "3">>
<<squareOL "114" "110" "50" "blue" "cyan" "3">>
<<rectangleOL "235" "115" "50" "20" "red" "orange" "3">>
<<ovalOL "325" "135" "25" "12" "green" "lime" "3">>
<<lineOL "50" "155" "390" "155" "cyan" "4">>
<<textOL "300" "170" "cyan" "line macro">>
</svg>

Macros only work inside a svg or a tiddler containing the svg shell above.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f9a0b5da-ae0b-4e6c-90cb-ebe3d8024274%40googlegroups.com.

Attachment: overlay svg shell.tid
Description: Binary data

Reply via email to