Is there any way to access the width of a SharpDX stroke style and change it dynamically? For regular strokes we have myStroke.Width. Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
SharpDX Stroke Style
Collapse
X
-
Hello Zeos6,
Thank you for your post.
StrokeStyle does not contain a width. Generally the object you pass StrokeStyle to will have an overload for the width of the object. For example, the RenderTargetDrawGeometry:
For more information please visit the following link: https://ninjatrader.com/support/help...trokestyle.htmCode:RenderTarget.DrawGeometry(g, Plots[0].BrushDX, Plots[0].Width, Plots[0].StrokeStyle);
Please let me know if you have any questions.
-
Hi PatrickH,
I am aware of the overload. But this means that if I need to adjust the width dynamically I need to add extra code. Awkward to say the least. Let me then ask you this, is there a way to recover the stroke from a stroke style created as myStroke.StrokeStyle, That way I could retrieve the width and create a new stroke style on the fly.
Comment
-
Hi PatrickH,
The idea is to be able to adjust the width of a SharpDX stroke dynamically. I can create the stroke style once and can reuse it without resorting to OnRenderTargetChanged() to reset the render target for strokes. This is currently creating havoc with some of my indicators, on loading the indicator. The indicators worked perfectly before I upgraded to the latest version of NT. So my thought was to create all my DX brushes and DX strokestyles once and thus not use OnrenderTargetChanged(). It appears that OnRenderTargetChanged() is called even before State = State.Configure where the strokes are initialized.Last edited by Zeos6; 06-01-2018, 03:15 PM.
Comment
-
Hello Zeos6,
Thank you for your response.
Can you detail what the behavior was with OnRenderTargetChanged() before the update and what you are seeing not with the new release of NinjaTrader 8?
Any code you can provide to explain what you were doing that was working but does not work now will be most helpful.
I look forward to your response.
Comment
-
Hi PatrickH,
Thank you for your response.
I don't want to duplicate efforts. I have detailed this in the following thread:
ChrisL answered me earlier but I am not sure if he is still following up on this.
However, there is one aspect that I did not address with ChrisL that you might be able to answer for me. It appears that in the new version of NT, OnRenderTargetChanged() gets executed before State == State.Configure. This means that DX brushes and strokes can no longer be reused as before since brushes and strokes are null until State.Configure is run. Therefore, can you please explain to me how to reuse DX brushes and strokes under the new version of NT?
As an aside, can you guys also add some color/brush helper methods to your DX extensions so that we can create DX brushes without the need for RenderTarget? I've had to write my own, but it would be helpful.
Thank you very much PatrickH.
EDIT: More specifically, and I have just verified it...
In the last version of NT (R 13), the order of execution was
State == State.Configure
OnRenderTargetChanged()
In R 14 of NT (current version), the execution order is
OnRenderTargetChanged()
State == State.Configure
Because of this change, DX brushes and strokes can no longer be reused as they haven't been configured yet.Last edited by Zeos6; 06-04-2018, 01:19 PM.
Comment
-
Hello Zeos6,
Thank you for your response.
I would like to forward the following as a feature request to our development team. Can you provide a use case and an example in code of one of these helper methods?
Originally posted by Zeos6 View PostAs an aside, can you guys also add some color/brush helper methods to your DX extensions so that we can create DX brushes without the need for RenderTarget? I've had to write my own, but it would be helpful.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment