Denver, CO
Experience: Advanced
Platform: SierraChart
Broker: Optimus, Rithmic
Trading: ES
Posts: 67 since Sep 2011
Thanks Given: 6
Thanks Received: 34
|
I dont think there are any existing functions in NinjaScript to do this for you, but its fairly easy to do with some .NET classes in System.Drawing:
Rectangle - create a rectangle with the X/Y width / height of what you want to capture - you can use ChartControl.Width, height, and location (x/y point) to create a rectangle of the whole chart.
Bitmap - create a new bitmap the size of your rectangle with an appropriate pixel format.
Graphics - use an instance of this on your bitmap w/ Graphics.FromImage(). Then you can use CopyFromScreen() with your given rectangle to do the actual screenshot.
Then you can use your bitmaps instance Bitmap.Save with a desired file type like JPEG, to save it to a stream.
Once you have it saved, you'll have to email it. Unfortunately I dont know how to send a mail off the top of my head. I'm assuming System.Net.Mail.SmtpClient would make short work of this.
|