W3C home > Mailing lists > Public > www-svg@w3.org > August 1999

Re: SVG suggestions (geoinformation)

From: Jon Ferraiolo <jferraio@Adobe.COM>
Date: Mon, 09 Aug 1999 10:17:42 -0700
Message-Id: <199908091714.KAA13562@mail-345.corp.Adobe.COM>
To: Ben Hutchings <benh@lsl.co.uk>
Cc: www-svg@w3.org
At 11:35 AM 8/9/99 +0100, Ben Hutchings wrote:
>>>8. Also nice would be fixed-size bitmaps, for small icons which we do not
>>>wish to change as window size (or zoom) increases. An absolute point or
>>>align/valign could be specified.
>>This can be done via clever construction of the document and its various
>><g> elements and the order of transform= attributes.
>Would you like to expand on that?
>I thought I could make fixed-size bitmaps by saying e.g. <image
>href="example.png" x=12 y=45 width="8px" height="8px">.  Is this not
>the case?

Yes, so long as there are no other embedded <svg> elements creating a new
viewport coordinate system, you can use the above <image> element to
achieve an image that is really 8 pixels square, where a "px" has the same
meaning as it does in HTML/CSS.

To illustrate:

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE ..... >
<svg width="3in" height="3in" 
           fitBoxToViewport="0 0 100 100" allowZoomAndPan="true" >
   <path d="M 0 0 L 10 80 L 80 80" style="fill:none; stroke: blue" />
   <g transform="translate(10 80)">
      <image href="example.png" x="-4px" y="-4px" width="8px" height="8px"/> 

The document above strokes a blue path that starts at (0,0), goes to
(10,80) and ends at (80,80) in user coordinates. It also draws a PNG image
defined in CSS units centered on top of (10,80). The image will always draw
centered on point (10,80) in user space and will always be 8px square, no
matter what kind of zooming the user does.

Received on Monday, 9 August 1999 13:16:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:46 UTC