xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: scale element to a specific size
Date Tue, 28 Sep 2010 22:39:53 GMT
Hi Muller,

Clemens Müller <mueller.clemens@chello.at> wrote on 09/13/2010 03:20:11 

> i want to scale an element so it has a specific size in pixels on 
> the screen. can you tell me how to achieve that? what exactly do i 
> have to do with the available matrices?

        This can vary a little depending on the SVG implementation but
in general getScreenCTM will give you the transform to the screen which
is generally a pixel based coordinate system (it can vary for example in
print contexts).  I believe that one unit in the screen coordinate system
will correspond to one pixel on the display.  Based on that you should be
able to calculate a scaling transform to map the bbox of an element to a
particular size in the screen coordinate system.

View raw message