Noobie question regarding CopyPixels

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
JayE
Posts: 2
Joined: 2018-04-05T18:08:34-07:00
Authentication code: 1152

Noobie question regarding CopyPixels

Post by JayE »

I'm trying to copy a PNG image (with alpha) onto a transparent/blank background PNG image, but the PNG image I am copying to the background is not displayed, probably because the background image is transparent.

How do I get CopyPixels to ignore the background image?
I tried lots of the Channels.xxx options but nothing seems to work the way I want it to.

// Background
bgndImage= new MagickImage(bytes);

// Copy image onto background
imgAdd = new MagickImage(bytes);
bgndImage.CopyPixels(imgAdd, new MagickGeometry(imgAdd.Width, imgAdd.Height), point.X, point.Y, Channels.RGB);
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Noobie question regarding CopyPixels

Post by dlemstra »

I wonder why you are using the CopyPixels method. I suspect you will need to use one of the Composite overloads to accomplish your goal.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
JayE
Posts: 2
Joined: 2018-04-05T18:08:34-07:00
Authentication code: 1152

Re: Noobie question regarding CopyPixels

Post by JayE »

Composite overloads?
How do I use those?
Post Reply