Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
screenshot share
Collapse
X
-
Hello,
Are you looking to share a screenshot of your entire monitor, or are you running into trouble with the Share > Window feature specifically? There is currently not a full-monitor image sharing feature built-in directly in NinjaTrader 8, but the Share > Window feature should share a screenshot of your entire chart.Dave I.NinjaTrader Product Management
-
just want to share my window. do you have an example of how i can programatically do it from my indicator?Originally posted by NinjaTrader_Dave View PostHello,
Are you looking to share a screenshot of your entire monitor, or are you running into trouble with the Share > Window feature specifically? There is currently not a full-monitor image sharing feature built-in directly in NinjaTrader 8, but the Share > Window feature should share a screenshot of your entire chart.
Comment
-
maybe i did not identify my question correctly. is there any programatic feature to take a screenshot of the chart window as part of indicator? I would need this to use the share feature to twitter?Originally posted by NinjaTrader_Dave View PostAbsolutely. Take a look at the documentation for the Share() method below:
There is an example of sharing a screenshot to Twitter on that page, which should do the trick for you.
- Likes 1
Comment
-
This seems like the best thread to highjack
I am trying to create a screenshot of the chart using the below code but the file is just saving as blank. Can anyone tell me why this is? Is the ChartControl the correc object to be passing? This is the way I did it in NT7 but maybe I need to be passing a window object of some sort or something?
Code:protected override void OnBarUpdate() { if (CurrentBar < Count -2)return; this.Dispatcher.Invoke((Action)(() => { if (!ScreenShotSaved){ CreateBitmapFromVisual(ChartControl,"d:\\test2.png"); Print("Just DOne"); ScreenShotSaved = true; } })); } public static void CreateBitmapFromVisual(ChartControl target, string fileName) { if (target == null || string.IsNullOrEmpty(fileName)) { return; } Rect bounds = VisualTreeHelper.GetDescendantBounds(target); RenderTargetBitmap renderTarget = new RenderTargetBitmap((Int32)bounds.Width, (Int32)bounds.Height, 96, 96, PixelFormats.Pbgra32); DrawingVisual visual = new DrawingVisual(); using (DrawingContext context = visual.RenderOpen()) { VisualBrush visualBrush = new VisualBrush(target); context.DrawRectangle(visualBrush, null, new Rect(new Point(), bounds.Size)); } renderTarget.Render(visual); PngBitmapEncoder bitmapEncoder = new PngBitmapEncoder(); bitmapEncoder.Frames.Add(BitmapFrame.Create(renderTarget)); using (Stream stm = File.Create(fileName)) { bitmapEncoder.Save(stm); } }
Comment
-
Take a look at the attached script, which may shed some light on how to tweak your code. This sample starts off similarly to your code, but takes a different approach to capturing and saving the actual image.Last edited by NinjaTrader_DaveI; 01-26-2016, 03:39 PM.Dave I.NinjaTrader Product Management
- Likes 3
Comment
-
you guys are just 1 click away from making this a built in functionOriginally posted by NinjaTrader_Dave View PostTake a look at the attached script, which may shed some light on how to tweak your code. This sample starts off similarly to your code, but takes a different approach to capturing and saving the actual image.
As we expect this to be part of the core product?
- Likes 1
Comment
-
Thanks Dave, This works fine.
For anyone interested, here is my adapted version which saves to memory stream then attaches to an email and sends.
I have tested this using Gmail and works fineAttached Files
- Likes 3
Comment
-
I just noticed that if the tab that the chart exists on is not selected, the screenshot comes though of the highlighted chart at that time. How do we get the image of the chart running the indicator rather than the current screen image?Originally posted by NinjaTrader_Dave View PostTake a look at the attached script, which may shed some light on how to tweak your code. This sample starts off similarly to your code, but takes a different approach to capturing and saving the actual image.
Cheers.
Comment
-
There will not be a way to do this using the methodology I shared below. Taking an image captures what is actually being rendered to the screen, and there is no such rendering occurring in an inactive tab. In an inactive tab, your script will have access to the underlying data used to construct a chart, but no actual rendered objects to capture.Dave I.NinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment