Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2007

Tip: Looking for answers? Try searching our database.

"sum" 2 bitmaps

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarcuEusebiu@gmail.com - 11 May 2007 09:45 GMT
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
Kevin Spencer - 11 May 2007 11:44 GMT
Use the System.Drawings.Graphics class. See the following resources:

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

Signature

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

> Hello...
> I have to bmps (100X100) and 1`st has an A on the left side and the
[quoted text clipped - 4 lines]
> Can someone help me?
> Thanks
MarcuEusebiu@gmail.com - 11 May 2007 13:41 GMT
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!!!
Moty Michaely - 11 May 2007 11:55 GMT
> Hello...
> I have to bmps (100X100) and 1`st has an A on the left side and the
[quoted text clipped - 4 lines]
> Can someone help me?
> Thanks

Hi Marcu,

Can you please explain your needs further?

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

Moty
MarcuEusebiu@gmail.com - 11 May 2007 13:12 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.