Bitmaps subtraction

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

How it is possible to subtract one bitmap from another. I did it in C++
(unmanaged) a lot of time ago, but is there nice method to do it witjh
managed GDI+ ?

{Bob, your turn ;) }

TNX
 
Hi Tamir,

I'd like to know the meaning of subtract in your post. Do you mean by
subtract the RGB value of each pixel in the bitmap image? Or which function
did you use in GDI to achieve this?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Yes
I want to make bitmap from two other bitmaps by subtracting it's color bit
values
 
Probably the best way to do it is by using the LockBits method to provide
access to the bitmap bits themselves and iterate through all the pixels
performing whatever arithmetic operation you need on a pixel for pixel
basis. There is no method that does this simply.

The GDI+ FAQ explains LockBits including how to access the specific R, G, B
and A bytes within the pixel.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Back
Top