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

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.
    JesseNinjaTrader Customer Service

    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.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post adeelshahzad  
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            3 views
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Working...
            X