Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add transparency to "Brush" statement

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

  • mlarocco
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello mlarocco,

    It looks like the code you are trying to use is not like the code in the help guide sample, here is the sample again:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromArgb(100, 56, 120, 153));
    myBrush.Freeze();
    These two lines create a new Brush. You can the use the myBrush wherever that is needed:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromArgb(100, 56, 120, 153));
    myBrush.Freeze();
    BackBrush = myBrush;
    Alright, I got it to work. Thanks for the help!!

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello mlarocco,

    It looks like the code you are trying to use is not like the code in the help guide sample, here is the sample again:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromArgb(100, 56, 120, 153));
    myBrush.Freeze();
    These two lines create a new Brush. You can the use the myBrush wherever that is needed:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromArgb(100, 56, 120, 153));
    myBrush.Freeze();
    BackBrush = myBrush;

    Leave a comment:


  • mlarocco
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello mlarocco,

    Can you post a copy of what you tried specifically along with the error you are seeing? We can't help with a problem if we don't have the code or know what error you are running into.


    Here is the original code that works...
    // Set 1
    if (High[0] == (Open[0] + (4 * TickSize)) )
    {
    BackBrush = Brushes.Blue;
    }

    However the stripe is full color, I would like it to have some transparency (opacity). I've tried this...
    // Set 1
    if (High[0] == (Open[0] + (4 * TickSize)) )
    {
    BackBrush = (Color.FromRgb(56, 120, 153));
    }

    and get a CS0029 error

    Tried this...
    // Set 1
    if (High[0] == (Open[0] + (4 * TickSize)) )
    {
    BackBrush = Brush(Color.FromRgb(56, 120, 153));
    }

    Get a CS0118 error

    Really don't know why it has to be so difficult to do a simple thing!

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello mlarocco,

    Can you post a copy of what you tried specifically along with the error you are seeing? We can't help with a problem if we don't have the code or know what error you are running into.



    Leave a comment:


  • mlarocco
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello mlarocco,

    What did you try?

    If you can provide a sample of what you tried that did not work we may be able to assist further.
    I tried adding SolidColorBrush(Color.FromRgb(56, 120, 153)); to the BackBrush statement, but no matter what I tried, it wouldn't compile. I am completely lost

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello mlarocco,

    What did you try?

    If you can provide a sample of what you tried that did not work we may be able to assist further.

    Leave a comment:


  • mlarocco
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello mlarocco,

    You can find information about working with opacity here: https://ninjatrader.com/support/help...gcustombrushes
    Thanks but I cannot get it to work...

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello mlarocco,

    You can find information about working with opacity here: https://ninjatrader.com/support/help...gcustombrushes

    Leave a comment:


  • mlarocco
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello mlarocco,

    Are you asking how to use a transparent brush? If so that is one of the options for Brushes:

    Code:
    BackBrush = Brushes.Transparent;
    Sorry, I wasn't very clear. I think the proper term would have been, I want to set opacity on the Brush, so it will still show but not be full color.

    Thanks

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello mlarocco,

    Are you asking how to use a transparent brush? If so that is one of the options for Brushes:

    Code:
    BackBrush = Brushes.Transparent;

    Leave a comment:


  • mlarocco
    started a topic Add transparency to "Brush" statement

    Add transparency to "Brush" statement

    I have been trying to find the syntax to add a transparency statement to my Brush statement, see code below....

    BackBrush = Brushes.Lime;
    EnterLong(Convert.ToInt32(Qty), @"Long Entry");

    Thanks

Latest Posts

Collapse

Topics Statistics Last Post
Started by kinfxhk, 07-14-2026, 09:39 AM
0 responses
17 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 10:18 AM
0 responses
59 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 09:50 AM
0 responses
43 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 07:21 AM
0 responses
47 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-11-2026, 02:11 AM
0 responses
38 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Working...
X