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 r68cervera, Today, 05:29 AM
|
0 responses
3 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
6 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,241 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
7 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment