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 inanazsocial, Today, 01:15 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by rocketman7, Today, 02:12 AM
          0 responses
          10 views
          0 likes
          Last Post rocketman7  
          Started by dustydbayer, Today, 01:59 AM
          0 responses
          2 views
          0 likes
          Last Post dustydbayer  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          23 views
          0 likes
          Last Post trilliantrader  
          Started by Davidtowleii, Today, 12:15 AM
          0 responses
          3 views
          0 likes
          Last Post Davidtowleii  
          Working...
          X