Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to clear/clean/remove all RenderTarget items

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

    how to clear/clean/remove all RenderTarget items

    Hi.
    inside OnRender, I draw different objects by i.e. `RenderTarget.DrawLine` ,`RenderTarget.DrawTextLayout` etc...

    however, on each script change/update, I get the duplicated items drawn (seems, the previous drawings are not removed).

    shortly, how to make the OnRender function, to clean/remove all previous execution's drawn items?
    (the same result when I remove indicator from chart and re-attach again, then it draws items on clean chart... i want the same to happen on each OnRender re-execution)
    Last edited by ttodua; 12-05-2017, 05:07 AM.

    #2
    Hello,

    Thank you for the post.

    OnRender is not like the drawing tools where you have a Tagging system, there is no cleanup of the lines needed. The only cleanup you would need to do would be resources like your TextLayout would need to be disposed of, but that would not draw a duplicate line on the next pass if you had not disposed of it.

    When OnRender is called, it is run from top to bottom to supply the platform with render information. That is used when the chart is repainted. There is no caching of this information so when your logic says to draw a line that happens or when your logic stops saying to draw that line, it would no longer be drawn or visible.

    Based on your comments, it sounds like whatever logic you are using to do the drawing is also duplicating the lines. Are you currently using conditions to draw the lines and then store information to variables or file? In short, we would need more information on the logic you are using to understand why that is being duplicated. If you have a simple example that demonstrates the duplication, we could review that together to see why that is happening.


    I look forward to being of further assistance.

    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
    367 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
    571 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