469,917 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

"sum" 2 bitmaps

Hello...
I have to bmps (100X100) and 1`st has an A on the left side and the
other has a B on the right side. I want to "sum" this bitmaps to
obtain a bitmap that contains "AB".
I thought to use GDI32 SelectObject and BitBtl methods.... but I had
no luck...
Can someone help me?
Thanks

May 11 '07 #1
4 2021
Use the System.Drawings.Graphics class. See the following resources:

http://msdn2.microsoft.com/en-us/lib....graphics.aspx
http://www.bobpowell.net/gdiplus_faq.htm

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

<Ma**********@gmail.comwrote in message
news:11*********************@e51g2000hsg.googlegro ups.com...
Hello...
I have to bmps (100X100) and 1`st has an A on the left side and the
other has a B on the right side. I want to "sum" this bitmaps to
obtain a bitmap that contains "AB".
I thought to use GDI32 SelectObject and BitBtl methods.... but I had
no luck...
Can someone help me?
Thanks

May 11 '07 #2

Ma**********@gmail.com wrote:
Hello...
I have to bmps (100X100) and 1`st has an A on the left side and the
other has a B on the right side. I want to "sum" this bitmaps to
obtain a bitmap that contains "AB".
I thought to use GDI32 SelectObject and BitBtl methods.... but I had
no luck...
Can someone help me?
Thanks
Hi Marcu,

Can you please explain your needs further?

Do you need one A&B concatenated BMP (200X100) ?

Moty

May 11 '07 #3
Seems that I forgot to mention that the result bitmap must be 100X100.
If I put A over B, B becomes the background of A... just like if A has
a transparent backgound, and if I put it over B, I can see the B
bitmap.

May 11 '07 #4
Thanks... on the Bob Powel website I have found the solution...

e.Graphics.DrawImage(a, new Point(0, 0));
ImageAttributes ia = new ImageAttributes();
ColorMatrix cm = new ColorMatrix();
cm.Matrix33 = 0.5f;
ia.SetColorMatrix(cm);
e.Graphics.DrawImage(b, new Rectangle(0, 0, b.Width, b.Height), 0, 0,
b.Width, b.Height, GraphicsUnit.Pixel, ia);

So simple....
Thanks!!!

May 11 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Fao | last post: by
10 posts views Thread by =?Utf-8?B?Q2hyaXMgRy4=?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.