Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveDrawObject

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

    RemoveDrawObject

    I appreciate this might not be supported but if the answer is really simple perhaps you could point me in the right direction.

    In your custom plot sample you draw a string like so....

    Code:
    graphics.DrawString("Lower left corner", textFont, textBrush, bounds.X + 10, bounds.Y + bounds.Height - 20, stringFormat);
    As it has no tag how would I remove just that string ?
    RemoveDrawObject("") needs a tag?

    #2
    Originally posted by Mindset View Post
    I appreciate this might not be supported but if the answer is really simple perhaps you could point me in the right direction.

    In your custom plot sample you draw a string like so....

    Code:
    graphics.DrawString("Lower left corner", textFont, textBrush, bounds.X + 10, bounds.Y + bounds.Height - 20, stringFormat);
    As it has no tag how would I remove just that string ?
    RemoveDrawObject("") needs a tag?
    In this example, we are overriding the Plot() method. Each time this method is called its repainting that entire panel thus, there is no requirement to remove it. You would need to add logic in the Plot() method that would paint or not paint items you want.
    RayNinjaTrader Customer Service

    Comment


      #3
      Work around

      Thanks Ray - I realised that I could put an if... else String.empty in my logic and then check if the str has a value.
      That solved it.
      It would however be worthwhile to be able to tag each graphics object with a name - perhaps you could add that to your future development.

      Comment


        #4
        Originally posted by Mindset View Post
        Thanks Ray - I realised that I could put an if... else String.empty in my logic and then check if the str has a value.
        That solved it.
        It would however be worthwhile to be able to tag each graphics object with a name - perhaps you could add that to your future development.
        I am glad its resolved. At this level, you are programming purely against the graphics class in .NET and not at the NinjaScript layer. If you want tagged draw objects you would have to use NinjaScript methods.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X