Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          557 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X