Javid Alimohideen wrote:
Can someone point me to some example as how to overlay SVG over an jpeg
image? I am using JSVGCanvas to display SVG. Also, is it possible if i zoom
in on the svg image the jpeg behind the SVG will be zoomed in too.

Just include the JPEG as part of the SVG in an <image> tag.

By the way, here's a handy script I used to conver PNG files to SVG
(this won't work on Windows).

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
#!/bin/sh
# $Id: png2svg.sh 4881 2005-05-20 19:57:41Z archie $

if [ "$#" -ne 1 ]; then
    echo Usage: png2svg file.png 1>&2
    exit 1
fi

 WIDTH=`file "$1" | sed 's/^.*, \([[:digit:]]\{1,\}\) x 
\([[:digit:]]\{1,\}\),.*$/\1/g'`
HEIGHT=`file "$1" | sed 's/^.*, \([[:digit:]]\{1,\}\) x 
\([[:digit:]]\{1,\}\),.*$/\2/g'`

WIDTH2=`expr $WIDTH / 2`
HEIGHT2=`expr $HEIGHT / 2`

B64=`openssl enc -base64 -e -in "$1" | tr -d '[:space:]'`

echo '<?xml version="1.0" encoding="utf-8"?>'
echo '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"'
echo '  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>'
echo '<svg xmlns="http://www.w3.org/2000/svg";'
echo '  xmlns:xlink="http://www.w3.org/1999/xlink";'
echo '  width="'$WIDTH'" height="'$HEIGHT'" viewBox="-'$WIDTH2' -'$HEIGHT2' 
'$WIDTH' '$HEIGHT'">'
echo '    <g transform="scale(1) translate(-'$WIDTH2', -'$HEIGHT2')">'
echo '        <image width="'$WIDTH'" height="'$HEIGHT'" 
xlink:href="data:;base64,'$B64'"/>'
echo '    </g>'
echo '</svg>'


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to