I outline some text in my indicator OnRender method and I have tried to offload it to a separate method using the following
Variables
private SharpDX.Vector2 textPoint1;
private SharpDX.Vector2 textPoint2;
private SharpDX.DirectWrite.TextLayout textLayout1;
private SharpDX.DirectWrite.TextLayout textLayout2;
private void OutlineClockText(int dx,int dy)
{
for ( dx = -1; dx <= 1; dx++)
{
for ( dy = -1; dy <= 1; dy++)
{
if (dx != 0 || dy != 0) // Skip the center point
{
var outlinePosition = new SharpDX.Vector2(textPoint1.X + dx, textPoint1.Y + dy);
RenderTarget.DrawTextLayout(outlinePosition, textLayout1, outlineBrush, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
outlinePosition = new SharpDX.Vector2(textPoint2.X + dx, textPoint2.Y + dy);
RenderTarget.DrawTextLayout(outlinePosition, textLayout2, counteroutlineBrush, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
}
}
}
}
Is it possible to do this in a method or does it have to be done in OnRender?
If it can, can you point me to where my error is?
thanks and Happy Xmas.

Comment