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
-
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
-
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.
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 2
Comment
-
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.
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 2
Comment
-
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 thedude, 11-14-2021, 08:44 AM
|
5 responses
531 views
0 likes
|
Last Post
by jmschmidt357
Today, 05:48 PM
|
||
Started by lorien, 08-08-2021, 07:33 AM
|
10 responses
711 views
0 likes
|
Last Post
by AndyM871
Today, 05:25 PM
|
||
Started by henann, Today, 04:47 PM
|
0 responses
2 views
0 likes
|
Last Post
by henann
Today, 04:47 PM
|
||
Started by zstheorist, 11-23-2024, 09:06 AM
|
3 responses
19 views
0 likes
|
Last Post Today, 04:06 PM | ||
Started by Ousher, 02-07-2022, 07:37 PM
|
6 responses
456 views
0 likes
|
Last Post
by nelslynn
Today, 03:53 PM
|
Comment