music7611 Posted December 8, 2005 Posted December 8, 2005 I'm making a tool for one of my computer games and I need to do some drawing on top of a bitmap. I can't make it black because the bitmap might be black. I can't make it white because the bitmap might be white. Is there someway to set a Pen or a Brush to draw an inverted color? Quote
Leaders snarfblam Posted December 8, 2005 Leaders Posted December 8, 2005 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. Quote [sIGPIC]e[/sIGPIC]
Diesel Posted December 9, 2005 Posted December 9, 2005 Wait a second...if all you are doing is going to set the background color on a canvas...why don't 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 it's rgb fields from 255... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.