I have a form that I added a transparency key of magenta to. I then add a panel to the form and dock fill it to create a shaded border as so:
private void addEditNcs_Paint(object sender, PaintEventArgs e)
{
var panel = (Panel)sender;
_mt6006.InmarsatCWin.Custom_Transparent_Window_Border(panel,
e,
SystemColors.Control,
Color.Transparent);
}
public void Custom_Transparent_Window_Border(Panel panel, PaintEventArgs e,
Color dark, Color light)
{
var gp = new GraphicsPath();
Draw_GraphicsPath(4, panel.ClientRectangle, gp);
var fillBrush = new PathGradientBrush(gp);
fillBrush.CenterColor = dark;
Color[] colorArray = {light};
fillBrush.SurroundColors = colorArray;
fillBrush.Blend = _mt6006.InmarsatCWin.GetWindowBorderBlend();
e.Graphics.FillPath(fillBrush, gp);
gp.CloseFigure();
}
public Blend GetWindowBorderBlend()
{
var relativeIntensities = new[] { 0f, 1f, 1f };
var relativePositions = new[] { 0f, .08f, 1f };
var blend = new Blend { Factors = relativeIntensities, Positions = relativePositions };
return blend;
}
Below is what it turns out to look like:
Why is the magenta showing when its set to the transparency key. I don't want the magenta to show at all, instead I want to be able to see what is behind it. Any idea on why this is happening? Thanks.