Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PointF and Intellisense question

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

    PointF and Intellisense question

    I'm having trouble dealing with PointF. I get the compiler error:
    The type or namespace name 'PointF' could not be found (are you missing a using directive or an assembly reference?)
    PointF is in System.Drawing, but knowing that does not seem to help me.
    • Intellisense in the NinjaScript editor does not show Drawing under System -- but Intellisense in Visual Studio does show it. (Why are the two different?)
    • Intellsense in Visual Studio also shows System.Drawing.PointF.
    • Adding a "using System.Drawing" line compiles, but does not solve the problem -- PointF is still not found.
    What am I doing wrong?

    #2
    Similar problem -- the Pen class. The code I am porting calls Pen.Dispose(). System.Windows.Media.Pen has no Dispose() method, so I presume I should use System.Drawing.Pen. That exists and has a Dispose() method, according to both Microsoft documentation and Visual Studio intellisense. However, when I explicitly qualify Pen as System.Drawing.Pen the NinjaScript compiler says Pen does not exist in the System.Drawing namespace.

    I tried one obvious thing -- closing NinjaTrader and then restarting it. Same problem.

    Question: what Pen should I be using?

    Why does the NinjaScript system disagree with Microsoft on System.Drawing and its contents?

    Am I, perhaps, running into .NET versioning issues? I doubt that because Visual Studio and the NinjaScript editor should agree and they do not agree.

    Comment


      #3
      I think the answer is that I need to get caught up -- System.Drawing is not used by NT8. I need to convert my code to SharpDX.

      I still do not understand why the NinjaScript editor and Visual Studio Intellisense do not agree, though.

      Comment


        #4
        Hello ETFVoyageur,

        Thank you for your post.

        Correct, NinjaTrader 8 uses System.Windows.Media instead of System.Drawing. Visual Studio likely is aware of the System.Drawing namespace however it is not included NinjaTrader 8 which is why you are seeing it in VS but not NT.

        Please let us know if you have any further questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X