I need to set a transparent color on a bitmap displayed in DirectX 9 (using C#). That part is easy - and it works for black. Simply create a ColorKey object and set both its ColorSpaceHighValue and ColorSpaceLowValue to 0, and all black on the bitmap becomes transparent. Problem is, how do I set a different color to be transparent? How do I for example specify an RGB value for my ColorKey? What exactly do High and Low value mean anyway? Each is an int - RGB values have three int values, not two.
I dont want to use pure black (RGB (0,0,0)) as my transparent color, but rather 'nearly' pure black (RGB (1,1,1)).
I've tried
myColorKey.ColorSpaceHighValue = Color.FromArgb(
1,
1,
1
).ToArgb();
myColorKey.ColorSpaceLowValue = Color.FromArgb(
1,
1,
1
).ToArgb();
, but this doesnt work. It seems the only color I can use for transparency is black, and all the online examples/tuts I've encountered use black as well. Seems to be a typical case of everyone copying from the same source example without trying to actually use the code in real-life.
Can anyone help me PLEASE
Thanks
Shukri
I dont want to use pure black (RGB (0,0,0)) as my transparent color, but rather 'nearly' pure black (RGB (1,1,1)).
I've tried
myColorKey.ColorSpaceHighValue = Color.FromArgb(
1,
1,
1
).ToArgb();
myColorKey.ColorSpaceLowValue = Color.FromArgb(
1,
1,
1
).ToArgb();
, but this doesnt work. It seems the only color I can use for transparency is black, and all the online examples/tuts I've encountered use black as well. Seems to be a typical case of everyone copying from the same source example without trying to actually use the code in real-life.
Can anyone help me PLEASE
Thanks
Shukri