Re: Merging two images

Felix Saphir <[email protected]> Wed, 28 Oct 2009 10:59:02 +0100
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
Bob Friesenhahn schrieb:
> On Tue, 27 Oct 2009, Felix Saphir wrote:
>>
>> Probably a very simple question, but what is the correct way to merge
>> two images side by side using the Magick++-API?
> 
> There are several different ways to accomplish this with different 
> amounts of control and convenience.  It can be done via appendImages() 
> or montageImages() as defined in Magick++/STL.h.  These are the most 
> automated ways to perform the task.
> 
> It can also be done (the hard way) by creating a canvas image large 
> enough for the two images to fit, and then using the Image composite() 
> method to composite the two images in the desired locations using the 
> CopyCompositeOp composition operator.  This approach requires that you 
> do all the size and placement computations yourself.

Thank you very much, Bob,

I read the STL documentation, but decided to do it "the hard way", 
because I cannot be sure, that all images will have the same height.

Your answer confirms the approach I took, and now it works :) Turns out, 
that I assumed the first parameter "const Image &compositeImage_"  to 
composite() was the destination image, not the source. Yes, I'm rather 
new to C/C++ ...

Regards,
Felix

-- 
  /^\ | ASCII Ribbon Campaign
  \ / | - no HTML in email and news
   x  | http://www.asciiribbon.org/
  / \ | http://www.gerstbach.at/2004/ascii

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference