Page 1 of 1

How do you make certain colors of a bitmap not show up in C#

Posted: Mon Feb 01, 2010 6:47 pm
by Manifest222
Note that I am using Visual C# 2008 Express Edition right now.

Hey guys, right now I'm working on a level editor and my tile set bitmap is set inside a Picture Box with the name of myTileSetPic.

A problem I have encountered is that with my level editor there are tiles like trees and stuff, but my tiles that are trees have the design of a tree, and then the rest of the tile is white. This is not transparency, but it is just white. What I need to figure out how to do is to take the whiteness of the bitmap, and sort of, cancel it out I guess. I basically need to make it so you can not see the white part of the tile. I have no idea how the hell to do this, so please tell me possibly a way to do this. Thanks.

Re: How do you make certain colors of a bitmap not show up in C#

Posted: Tue Feb 02, 2010 8:34 am
by RyanPridgeon
Here you go :)

http://msdn.microsoft.com/en-us/library ... arent.aspx

This function sets one of the colours in the image to be displayed as transparent I believe.

Re: How do you make certain colors of a bitmap not show up in C#

Posted: Thu Feb 04, 2010 3:46 pm
by dandymcgee
RyanPridgeon wrote:Here you go :)

http://msdn.microsoft.com/en-us/library ... arent.aspx

This function sets one of the colours in the image to be displayed as transparent I believe.
Yup, just used that function about 2 hours ago in class.

Re: How do you make certain colors of a bitmap not show up in C#

Posted: Fri Feb 05, 2010 10:32 am
by RyanPridgeon
What's funny is I don't even have any form of C# compiler installed. I've never used GDI and I've barely touched the language, but I find this stuff by a couple of searches in google.

I'm amazed people still can't use Google or a good reference like MSDN :lol:

But still happy to help ^^