C# DirectX SolidColorBrush draws always Black

114 Views Asked by At

I am creating a SolidColorBrush and draw with it like that:

public int CreateBrush(Color color) {
    if (color.A == 0) {
        color = Color.FromArgb(255, color);
    }

    _brushContainer.Add(new SolidColorBrush(_device, new RawColor4(color.R, color.G, color.B, color.A / 255.0f)));
    return _brushContainer.Count - 1;
}

int _redBrush = overlay.Graphics.CreateBrush(Color.FromArgb(1, 198 / 255, 17 / 255, 17 / 255));

overlay.Graphics.FillCircle(10 + playerRadarPos.x, overlay.Height - height - 10, 5, colors[p.PlayerInfo.Value.ColorId]);

Now when I draw using this brush the color is always black. When I create if with the values r: 255, g: 0, b: 0 for example it works. Has anyone an idea how I can fix that or why it is only drawing black.

Thanks for your help and time.

0

There are 0 best solutions below