Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?
  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]
Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...