473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with SVG transformations

Hi,

I'm a newbie in SVG, I've been trying to get the svg below working for
sometime now, I need help:

<?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 xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" zoomAndPan="disable">

<g transform="translate(10mm,10mm)">
<rect x="0mm" y="0mm" width="100mm" height="30mm"
style="fill:red;stroke:black;stroke-width:1mm"/>
</g>
</svg>

The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?

Any help would be appreciated

Nov 30 '06 #1
3 1236
M.******@gmail.com wrote:
The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?
Transformation is implemented as a matrix-multiplication operation upon
the coordinates. As such, it is unitless; the units are those of the
original coordinates it is being applied to. See the detailed
descriptions at
http://www.w3.org/TR/SVG11/coords.ht...gANewUserSpace

(If you aren't familiar with matrix math operations, you really should
invest a bit of time in learning about them -- they're a fairly basic
tool for computer graphics work.)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Dec 1 '06 #2
Joe Kesselman wrote:
the coordinates. As such, it is unitless
.... or at least, that's how I read it. Certainly the scaling columns
have to be unitless (you don't want to multiply cm by cm when the result
is supposed to be cm). I suppose the additive column could and perhaps
should carry units, but I don't see provision for that in the spec. I
may be missing something (and whoever implemented the version you're
using may have missed the same thing I did), but...

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Dec 1 '06 #3

Joe Kesselman wrote:
M.******@gmail.com wrote:
The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?

Transformation is implemented as a matrix-multiplication operation upon
the coordinates. As such, it is unitless; the units are those of the
original coordinates it is being applied to. See the detailed
descriptions at
http://www.w3.org/TR/SVG11/coords.ht...gANewUserSpace

(If you aren't familiar with matrix math operations, you really should
invest a bit of time in learning about them -- they're a fairly basic
tool for computer graphics work.)
Thanks joe for the the reply,
I have looked into the spec before, not only that page but many other
pages as well and I ended up not finding a solution, I'm familiar with
matrices and if you know a solution, please post a sample svg code to
show that, I'm really frustrated as even a google search on this didn't
get me anywhere.
Thanks in advance

Dec 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike | last post by:
I am trying to code vb.net to perform XML transformations by applying a style sheet to a XML doc. All of my XML and XSLT documents will be in either XML DOM Objects or string variables. I am not...
1
by: KwiKiwi | last post by:
Hey, I'm doing a series of XSL Transformations from a C#.NET Console app. I've designed a .xsl file (to output to "text" not "xml") to generate a text file with entries that look like: ...
0
by: Mike | last post by:
I am trying to code vb.net to perform XML transformations by applying a style sheet to a XML doc. All of my XML and XSLT documents will be in either XML DOM Objects or string variables. I am not...
6
by: Christopher | last post by:
I am currently in the process of evaluating the performance hits of moving to the .NET platform for our application. I created a sample project that loads the transforms the same XML and XSLT in...
0
by: Mohan | last post by:
Hi, I am trying to create a DTS package wherein the data from the sql server is transfered to a text file. I am using the Transform Data Task to transfer the data.In Transform Data task...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.