Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange OnRender errors

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

    Strange OnRender errors

    I am getting the following error in my log:

    Time Category Message
    8/28/2020 3:34:33 PM NinjaScript Chart rendering failed. There is likely a problem with a chart object's OnRender method. D2D error = 'HRESULT: [0x88990001], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_WRONG_STATE/WrongState], Message: The object was not in the correct state to process the method. '


    I am reading the Help guide section on OnRenderTargetChanged() and I noticed I am not calling this method at all in my code. However, I am using a function to do the drawing in OnRender so I am not sure how to directly use OnRenderTargetChanged() since my DX brushes are created and destroyed inside the function. My first question, is: Should I avoid using a draw function in OnRender and instead write the drawing code directly so that the DX brushes are available to OnRenderTargetChanged()? Could this be my problem or should I look elsewhere?

    #2
    Hello swcooke,

    Below is a link to an example of re-using brushes that are created/disposed in OnRenderTargetChanged().
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    89 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    74 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    72 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    60 views
    0 likes
    Last Post CarlTrading  
    Working...
    X