Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Font (Chart -> Properties -> General -> Font) in SharpDX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to use Font (Chart -> Properties -> General -> Font) in SharpDX

    I would like to use the Font (Chart -> Properties -> General -> Font) in SharpDX.

    Click image for larger version

Name:	NT82020-12-08_233215.jpg
Views:	346
Size:	36.8 KB
ID:	1131373

    At the moment I use the following code:
    SharpDX.Direct2D1.Brush textDXBrush = new SolidColorBrush((Color) ColorConverter.ConvertFromString((ChartControl.Pro perties.ChartText).ToString())).ToDxBrush(RenderTa rget);

    to get just the color.

    Is there a better methode to get the complete Font properties?


    #2
    Hello Goldy,
    I am not certain about SharpDX but you can use Font Family as below:
    Code:
    In SetDefaults,[INDENT]myFont = new SimpleFont("Arial", 12);[/INDENT]
     In Properties,[INDENT][NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "My Font", GroupName = "Parameters", Order = 0)]
    public SimpleFont myFont { get; set; }[/INDENT]
    Hope it helps!

    Comment


      #3
      Hello s.kinra,
      thank you, but this was not my question.
      In your code you declare a new Font ("Arial",12). I want to use the existing from NT Chart Properties

      Comment


        #4
        Hello Goldy,
        If you wish to use the Font from Chart Properties then you can use
        Code:
        ChartControl.Properties.LabelFont

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        156 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        140 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X