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:	348
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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        44 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        56 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        35 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        95 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        57 views
        0 likes
        Last Post PaulMohn  
        Working...
        X