You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Michael Voyes <qm...@ocegr.fr> on 2004/10/25 14:05:22 UTC
gif image Auto-Scale
I use a SVG File into which a Gif file is referenced. The gif file
dimensions are ignored when my software rasterize it (using Batik) but
i'm looking for an Auto Scale to the 250*250 pixels dimension provided
as image attribute :
<image width="250" height="250" preserveAspectRatio="xMidYMid meet"
id="XMLID_1_" xlink:href="logo.gif" transform="matrix(1 0 0 1 2800 50)"/>
Problem is that image rendered is not fitted to the 250*250 pixels box.
What attribute must i set into my SVG file such as the logo.gif file
auto-scales to the 250*250 pixels box with aspect ratio preserved ?
Thanks in advance for your answers.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: gif image Auto-Scale
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Michael,
Michael Voyes wrote:
> I use a SVG File into which a Gif file is referenced. The gif file
> dimensions are ignored when my software rasterize it (using Batik) but
> i'm looking for an Auto Scale to the 250*250 pixels dimension provided
> as image attribute :
>
> <image width="250" height="250" preserveAspectRatio="xMidYMid meet"
> id="XMLID_1_" xlink:href="logo.gif" transform="matrix(1 0 0 1 2800 50)"/>
>
> Problem is that image rendered is not fitted to the 250*250 pixels box.
> What attribute must i set into my SVG file such as the logo.gif file
> auto-scales to the 250*250 pixels box with aspect ratio preserved ?
I think you misunderstand the meaning of width="250" height="250".
They don't mean make it 250 pixels, they mean make it 250 userspace
units wide/high. Based on your transform (shift 2800 in x) I suspect
that your userspace is not mapped 1:1 with screen/output pixels.
To know I would have to see the rest of your document.
Typically the best way to setup this mapping is to have
width/height attributes using pixels and a viewBox attribute
with a matching width/height on the outermost SVG element,
and stay away from transform after that:
<svg width="1000px" height="1000px" viewBox="0 0 1000 1000">
...
> Thanks in advance for your answers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org