473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

"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 2182
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nuno | last post by:
Is there any SQL Error? Or I have to use Select case in VB code to control SQL instead. Thank you for any ans. Nuno
6
by: Fao | last post by:
Hi, I am in my first year of C++ in college and my professor wants me to Write a Program with multiple functions,to input two sets of user-defined data types: One type named 'Sign' declared by...
13
by: Fao | last post by:
Hello, I am having some problems with inheritance. The compiler does not not return any error messages, but when I execute the program, it only allows me to enter the number, but nothing else...
5
by: Knuxus | last post by:
Hello. There is a problem in one of my forms, which also applies to reports in the same way... there is 3 fields Price and Quantity and Total Price. The field Total Price is made in expression...
10
by: =?Utf-8?B?Q2hyaXMgRy4=?= | last post by:
How would I output a row for the Computed sums? I just want to append it as a row at the bottom of my gridview table.
10
by: jonathanemil | last post by:
Hello, I am a 1st semester Computer Science student in a Python class. Our current assignment calls for us to read a list from a file, create a 2-dimensional list from the file, and check to see...
1
by: Daikide | last post by:
I need average for my program. And I'm using it multiple time in my program. I'm doing this in PVSS: So say average float is 2.0013005 (FOR EXAMPLE) but the number in the end can be higher......
1
by: eclipse93081 | last post by:
I need a way to sum check boxes in Access. On the database interface I have 3 boxes you can check; "Scheduled/Went On", "Scheduled/Did Not Go On", and "Not Scheduled". I have the boxes set up as...
4
Alireza355
by: Alireza355 | last post by:
I have a table, with 3 columns: column1 column2 column 3 10 some numbers here some text here 11 some numbers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.