Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Functions from System.Drawing namespace

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

    Functions from System.Drawing namespace

    The Custom Drawing section of the Help Guide (under Shared Draw Methods and Properties) states the following:

    There are virtually no limits for custom drawing on a chart panel. Since NinjaScript is based on Microsoft C#, the entire System.Drawing namespace is available for use. Custom drawing is an advanced programming topic and should only be considered by programmers familiar with Microsoft C# and the .NET Framework.

    I would like to draw variable-width rectangles on my charts, but the drawing functions described in the help guide don't seem to have a property by which to scale the size of the object that is drawn.

    Can you please point me in the right direction with C#/.NET for calling a drawing function that will basically operate the same as the DrawSquare function, but which will allow me to control the width by way of a variable reference? I looked through the System.Drawing documentation on the MSDN website, but I don't even know where to begin in terms of identifying a specific function to call.

    Thank you.


    Regards,

    #2
    Unfortunately this is beyond what we provide support for.

    I suggest taking a look at CustomPlotSample indicator and take it from there.

    Comment


      #3
      Try graphics.DrawRectangle

      Comment


        #4
        Originally posted by Elliott Wave View Post
        Try graphics.DrawRectangle

        Many thanks, EW. I overlooked that function thinking it worked the same way as DrawDot and DrawSquare (i.e., non-scalable).


        Regards,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        42 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        29 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Working...
        X