Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Screenshot from code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Screenshot from code

    Hi,
    is there a way to get a chart screenshot from code?
    I've tried the following with ChartPanel.PanelsAreaRectangle but only get a black rectangle. The code is first called like this:

    Code:
    // have to invoke on the thread that owns the chart panel, otherwise THIS thread has no access
    	            	ChartPanel.Dispatcher.Invoke(new System.Action(() => GetScreenShot(...);
    
    private void GetScreenShot(...)
    {
    			System.Windows.Media.Imaging.RenderTargetBitmap renderTargetBitmap = new System.Windows.Media.Imaging.RenderTargetBitmap(ChartPanel.W, ChartPanel.H, (double)RenderTarget.DotsPerInch.Width, (double)RenderTarget.DotsPerInch.Height, PixelFormats.Default);
    			renderTargetBitmap.Render(ChartControl.PanelsAreaRectangle); 
    
    // etc
    Cheers,
    saltminer

    #2
    Hello saltminer, and thank you for your question. I will leave this question up on the forums to see if any member of the community can help, as this is outside the scope of the support we can provide directly.
    Last edited by NinjaTrader_JessicaP; 02-08-2017, 08:03 AM.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      LOL, I am a NinjaScript consultant. I put this post in the wrong forum though; it is an NT8 question.
      Cheers,
      saltminer

      Comment


        #4
        My apologies, this has been moved and I have edited my previous reply.

        This publicly available stack overflow discussion may be useful.

        I will like to get a screen capture and save it in the format of png of the entire screen. How can I do that? Could I use the Snipping Tool library to accomplish this? There are some tutorials on...
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hi Saltminer, you can check out the script i shared here, has screen shot code within.



          It you can only access the screenshot of the active tab in the window unfortunately, I am hoping for a way to screenshot tab specific.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          5 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          12 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Yesterday, 08:42 PM
          0 responses
          11 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Yesterday, 07:51 PM
          0 responses
          13 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,982 views
          3 likes
          Last Post jhudas88  
          Working...
          X