So is this how you will draw a line that’s partially off the screen using SharpDX? Or you have a better way to draw?
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
base.OnRender(chartControl, chartScale);
// Create brush for the line
SharpDX.Direct2D1.SolidColorBrush customDXBrush = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, SharpDX.Color.DodgerBlue);
// Purposely crate an partially off the screen line
SharpDX.Vector2 startPoint = new SharpDX.Vector2(ChartPanel.X - 20, ChartPanel.Y - 20);
SharpDX.Vector2 endPoint = new SharpDX.Vector2(ChartPanel.X + ChartPanel.W + 20, ChartPanel.Y + ChartPanel.H + 20);
RenderTarget.DrawLine(startPoint, endPoint, customDXBrush, 2);
// Dispose
customDXBrush.Dispose();
}

Comment