Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SVG as Image in Mozilla

2 views
Skip to first unread message

Natarajan Thanikachalam

unread,
Jul 26, 2009, 5:16:33 AM7/26/09
to
Hi,

As I understand, Mozilla renders SVG as a document, rather than as an
Image, given this, can you please help me on

1) How do I get to know the dimensions of an SVG (doc/image)?
2) How do I scale an SVG (doc/image)?

Many Thanks for your help in advance,
Kind Regards,

Natarajan.

codedread

unread,
Jul 26, 2009, 8:56:54 PM7/26/09
to
The point of SVG is to have truly scalable images. The SVG image
itself may not have explicit dimensions.

The <svg> element gets a width/height attributes so you can set those
explicitly. These attributes default to 100% though so you can also
set the containing element to the size you want and the image will
scale to it.

If you want to scale an SVG image, you can remove the explicit width/
height (so they default to 100%) and then scale the containing
element (the <div> in an inline case or the <object> in a referenced-
SVG case). You can also change the value of the viewBox attribute on
the <svg> element to change the scale and position of the image.

HTH,
Jeff Schiller

On Jul 26, 4:16 am, Natarajan Thanikachalam

0 new messages