Inverting Colors With Pens And/Or Brushes

music7611

Active member
Joined
Jan 24, 2004
Messages
35
Im making a tool for one of my computer games and I need to do some drawing on top of a bitmap. I cant make it black because the bitmap might be black. I cant make it white because the bitmap might be white. Is there someway to set a Pen or a Brush to draw an inverted color?
 
You can modify the image, pixel for pixel, by yourself. You can achieve a major performance gain by using the System.Runtime.Interop.Marshal class to copy the image data to an array, edit the data in the array, and copy the image data back to the image. You might be also able to draw inverted colors using GDI through Windows API.
 
Wait a second...if all you are doing is going to set the background color on a canvas...why dont you just set the color of the pen after the background color is set????

Once the background color is set...create an inverted color
by subtracting its rgb fields from 255...
 
Back
Top