xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olivierk <okite...@gmail.com>
Subject Re: How do I merge 2 EPS images?
Date Thu, 16 Dec 2010 22:29:49 GMT


Jeremias Maerki-2 wrote:
> 
>> > I've quickly made a copy of that and adjusted it to how I would do it.
>> > The result is a valid EPS document which displays the embedded EPS
>> files,
>> > but just not in the right position, yet. You'll have to experiment and
>> > keep in mind that PostScript's coordinate system grows from bottom up
>> > with increasing Y coordinate (and not top to bottom). I've attached the
>> > result.
> 

Thanks for the help, it is working fine now. That's exactly what I needed
:).
Some of the things I wasn't doing right (or not doing at all) in the
previous version of my code are getting instances of RawImageEPS,
EPSDocumentGraphics2D, draw a rectangle and get a generator from the
Graphics2D object.
Another thing I had to correct is the center image alignment algorithm.
After numerous experiments this is what I found to center the image (there's
probably a better way to do it, but for now I'm content with it), maybe it
will help other users too.


//the bounding box and viewport of the center image
Rectangle bbox  = new Rectangle( 0, (borderH - centerH) / 4, centerW,
centerH);
Rectangle viewport = new Rectangle((borderW - centerW) / 2, 0, centerW,
centerH);
PSImageUtils.renderEPS(centerStream, "", viewport, bbox, gen);

Cheers,

Olivier.

-- 
View this message in context: http://old.nabble.com/How-do-I-merge-2-EPS-images--tp30448446p30476929.html
Sent from the Xml Graphics - General mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Mime
View raw message