Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 sastrades, 05-10-2024, 09:59 AM
    3 responses
    54 views
    0 likes
    Last Post rc5781
    by rc5781
     
    Started by guyonabuffalo, Yesterday, 10:01 PM
    2 responses
    18 views
    0 likes
    Last Post guyonabuffalo  
    Started by thumper57, Yesterday, 04:30 PM
    5 responses
    16 views
    0 likes
    Last Post thumper57  
    Started by reynoldsn, 05-10-2024, 07:04 PM
    5 responses
    27 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by llanqui, Today, 11:10 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X