Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add transparency to "Brush" statement
Collapse
X
-
Alright, I got it to work. Thanks for the help!!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:
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();
Code:Brush myBrush = new SolidColorBrush(Color.FromArgb(100, 56, 120, 153)); myBrush.Freeze(); BackBrush = myBrush;
Leave a comment:
-
Here is the original code that works...Originally posted by NinjaTrader_Jesse View PostHello 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.
// 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:
-
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:
-
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 lostOriginally posted by NinjaTrader_Jesse View PostHello 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:
-
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:
-
Thanks but I cannot get it to work...Originally posted by NinjaTrader_Jesse View PostHello mlarocco,
You can find information about working with opacity here: https://ninjatrader.com/support/help...gcustombrushes
Leave a comment:
-
Hello mlarocco,
You can find information about working with opacity here: https://ninjatrader.com/support/help...gcustombrushes
Leave a comment:
-
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.Originally posted by NinjaTrader_Jesse View PostHello mlarocco,
Are you asking how to use a transparent brush? If so that is one of the options for Brushes:
Code:BackBrush = Brushes.Transparent;
Thanks
Leave a comment:
-
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:
-
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");
ThanksTags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by kinfxhk, 07-14-2026, 09:39 AM
|
0 responses
17 views
0 likes
|
Last Post
by kinfxhk
07-14-2026, 09:39 AM
|
||
|
Started by kinfxhk, 07-13-2026, 10:18 AM
|
0 responses
59 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 10:18 AM
|
||
|
Started by kinfxhk, 07-13-2026, 09:50 AM
|
0 responses
43 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 09:50 AM
|
||
|
Started by kinfxhk, 07-13-2026, 07:21 AM
|
0 responses
47 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 07:21 AM
|
||
|
Started by kinfxhk, 07-11-2026, 02:11 AM
|
0 responses
38 views
0 likes
|
Last Post
by kinfxhk
07-11-2026, 02:11 AM
|

Leave a comment: