How to merge two icons together? (overlay one icon on top of another)

Posted by demoncodemonkey on Stack Overflow See other posts from Stack Overflow or by demoncodemonkey
Published on 2010-04-08T12:30:43Z Indexed on 2010/04/09 17:23 UTC
Read the original article Hit count: 214

Filed under:
|
|
|
|

I've got two 16x16 RGB/A .ICO icon files, each loaded into a separate System.Drawing.Icon object.

How would you create a new Icon object containing the merge of the two icons (one overlaid on top of the other)?


Edit:
I probably wasn't too clear, I don't want to blend two images into each other, I want to overlay one icon on top of another.

I should add that the icons already contain transparent parts and I do not need any transparent "blending" to make both icons visible. What I need is to overlay the non-transparent pixels of one icon over the top of another icon. The transparent pixels should let the background icon show through.

For example, look at the stackoverflow icon. It has some areas that are grey and orange, and some areas that are totally transparent. Imagine you want to overlay the SO icon on top of the Firefox icon. You would see the greys and oranges of the SO icon in full colour, and where the SO icon is transparent, you would see those parts of the Firefox icon.

© Stack Overflow or respective owner

Related posts about c#

Related posts about merge