I m making a program in SDL.NET, where I need to draw a filled polygon. I figured it might be good to reuse the polygon surface instead of remaking it every time i need to draw, so I make the surface like this, and then save it to a dictionary afterwards:
polySur = Video.Screen.CreateCompatibleSurface(70, 70, true);
polySur.TransparentColor = Color.Magenta;
polySur.Fill(Color.Magenta);
polySur.Transparent = true;
poly.Draw(polySur, Color.LightGreen, false, true);
poly
is the Polygon
object I ve created beforehand.
You might think that this will draw a light green polygon when the surface is blitted to the screen; it doesn t. The resulting polygon is cyan! I discovered through experimentation that if I make a Color with Color.FromArgb
, the R channel becomes red, G channel becomes cyan, and B channel becomes black.
However, if I set the second boolean in the Draw call to false (disabling the filling), i get a light green outline. Obviously, the fill operation is causing the colors to mess up.
Any ideas?