Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw a Line with ability to define opacity

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

    Draw a Line with ability to define opacity

    Is there a way to DrawLine within NT7 with opacity. I dont see a parameter for this.

    Obviously draw rectangle has this but only applies to the region between the 4 points ? Not sure the effect of having outer rectangle drawn as a line ie 0 value for the Y value on begin and end points and then defining the opacity.

    Perhaps there is a way in overriding the Plot but even then looking at the MSDN .NET documentation for draw methods i dont see anything.

    Perhaps this is something that can be performed more readily with DirectX in the NT8 release?

    any insight or workaround appreciated

    thanks

    #2
    Hello,

    You can use alpha in NinjaTrader 7, you would need to use Color.FromArgb(20, Color.Red) instead of just a Color.

    You can supply a Color or an RGB value to FromArgb, the 20 is the Opacity between 0 and 255.

    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 08-10-2015, 10:25 AM.

    Comment


      #3
      From 0 to 255.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment


        #4
        Thanks guys testing it out. Appreciate prompt replies

        Comment


          #5
          for NT 8 :
          MyColor =Color.Red;
          int MyOpacity = 30;
          TransparentColor = new Color {A = Convert.ToByte(MyOpacity), R=MyColor.R, G=MyColor.G, B=MyColor.B} ;

          Comment


            #6
            Hello,

            Thank you for the reply.

            For NT8 items, in the future please post new questions to the NT8 subforum and if needed please provide a link to relevant nt7 posts.

            NT8 uses Brushes now, for opacity on a Brush please see the following documentation: https://ninjatrader.com/support/help...th_brushes.htm

            The Custom brush documentation shows some example of how to define a custom brush with opacity. Because NT8 no longer uses the System.Drawing namespace, the way colors are handled has changed as well. You should also note that any item which had "color" in its name for nt7 will now be replaced as "brush".

            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
            577 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X