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 junkone, Today, 11:37 AM
          0 responses
          2 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          34 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          34 views
          0 likes
          Last Post love2code2trade  
          Started by cls71, Today, 04:45 AM
          2 responses
          10 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Working...
          X