DirectWriteFactory

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > Charts > Rendering >

DirectWriteFactory

Previous page Return to chapter overview Next page

Definition

Provides an default DirectWrite factory used for creating SharpDX.DirectWrite components.

 

Property Value

A read-only SharpDX.DirectWrite.Factory used to create DirectWrite objects compatible with NinjaTrader rendering

 

Syntax

NinjaTrader.Core.Globals.DirectWriteFactory

 

ns


// create a text format object with default NinjaTrader DirectWrite factory
SharpDX.DirectWrite.TextFormat textFormat = new SharpDX.DirectWrite.TextFormat(NinjaTrader.Core.Globals.DirectWriteFactory,
  "Arial", 12f);
 
// create a text layout object with default NinjaTrader DirectWrite factory
SharpDX.DirectWrite.TextLayout textLayout = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Globals.DirectWriteFactory,
  "text to render", textFormat, ChartPanel.W, ChartPanel.H);