2016-07-19 07:48:20:525 ERROR: Data.ColorSeries.Set: Color series exceeds the maximum number (65535) of unique brushes. Please adjust code to use fewer brushes.
I've enclosed much of my code within try/catch, but no exceptions are caught that match the trace file, so I can't be sure where the problem might be.
Today, I encountered a different error caught in my custom OnRender(): External component has thrown an exception. This has the unfortunate effect of freezing all charts and the SuperDOM. A Basic Entry window and T&S window continue to update with bid/ask data, but that's all. I'm forced to kill the NT8 process via Task Manager because mouse clicks anywhere on NT menus are ignored.
Here's some sample code that I call from OnRender() to fill a geometry with a variable SolidColorBrush, whose A, R, G, B values are calculated elsewhere. Am I doing something wrong?
Brush tempBrush1 = new SolidColorBrush(Color.FromArgb((byte)ci_alpha, aby_red, 0, aby_blue));
tempBrush1.Freeze();
SharpDX.Direct2D1.Brush brushDXbid = tempBrush1.ToDxBrush(RenderTarget);
SharpDX.Vector2[] vectors1 = new [] {ap_bid1.ToVector2(), ap_bid2.ToVector2(), ap_bid3.ToVector2() };
SharpDX.Direct2D1.PathGeometry geo1 = new SharpDX.Direct2D1.PathGeometry(Core.Globals.D2DFactory);
SharpDX.Direct2D1.GeometrySink sink1 = geo1.Open();
sink1.BeginFigure(ap_bid0.ToVector2(), SharpDX.Direct2D1.FigureBegin.Filled);
sink1.AddLines(vectors1);
sink1.EndFigure(SharpDX.Direct2D1.FigureEnd.Closed);
sink1.Close();
RenderTarget.FillGeometry(geo1, brushDXbid);
geo1.Dispose();
sink1.Dispose();
brushDXbid.Dispose();

Comment