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 Ja...@tietoenator.com on 2006/05/23 10:33:40 UTC
Batik preserveAspectRatioDefect?
Hello,
I'm experiencing some strange behaviour with
preserveAspectRatio='xMidYMid slice'
during rendering images to bitmap using transcoder.
SVG spec. says that 'slice' mode means that entire viewport will be
covered with the viewbox contents, that means that always whole painting
area should be covered, and possibly some areas should be clipped, when
aspect ratios of image and viewport does not match. But what I get as
result
in this case from batik, is that painting area is not covered whole with
image, it is clipped some strange way. Is this some batik defect, or I'm
missing something? This is piece of code:
String svgURI = new File(svgFileName).toURI().toString();
TranscoderInput input = new TranscoderInput(svgURI);
RasterTranscoder transcoder = new RasterTranscoder("xMidYMid slice");
transcoder.setTranscodingHints(transcoderHints);
transcoder.transcode(input, null);
BufferedImage svgAsBufferedImage = transcoder.getBufferedImage();
'transcodereHints' contains only specs. of viewport: 352x416 pixels.
Any ideas?
Thanks and best regards,
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Batik preserveAspectRatioDefect?
Posted by th...@kodak.com.
Hi Jan,
<Ja...@tietoenator.com> wrote on 05/23/2006 04:33:40 AM:
> I'm experiencing some strange behaviour with
>
> preserveAspectRatio='xMidYMid slice'
>
> during rendering images to bitmap using transcoder.
The basic functionality in Batik of viewBox->viewport mapping
is pretty well tested.
> But what I get as result in this case from batik, is that painting
> area is not covered whole with image, it is clipped some strange
> way. Is this some batik defect, or I'm missing something? This
> is piece of code:
This code sample isn't useful for helping you.
> RasterTranscoder transcoder = new RasterTranscoder("xMidYMid slice");
This seems to be a key class, yet it is not part of Batik so I
don't know how it is supposed to apply 'xMidYMid slice' to the
rendering.
> transcoder.setTranscodingHints(transcoderHints);
> transcoder.transcode(input, null);
> BufferedImage svgAsBufferedImage = transcoder.getBufferedImage();
>
> 'transcodereHints' contains only specs. of viewport: 352x416 pixels.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org