Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Screenshot

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

    Screenshot

    Hello,
    I have downloaded the screenshot indicator from the ninjatrader app (ScreenshotTakerExample_NT8B13.zip) and I would like the file to have the date of when the screenshot was taken.
    I have tried this and it doesn't work,

    ORIGINAL:
    PngBitmapEncoder png = new PngBitmapEncoder();
    png.Frames.Add(outputFrame);
    using (Stream stream = File.Create(string.Format(@"{0}\{1}", Core.Globals.UserDataDir , "MyScreenshot.png")) png.Save(stream);​


    MODIFIED:
    ​​​​​​​PngBitmapEncoder png = new PngBitmapEncoder();
    png.Frames.Add(outputFrame);
    using (Stream stream = File.Create(string.Format(@"{0}\{1}", Core.Globals.UserDataDir , MyScreenshot" + DateTime.Now.ToString(" "+"d/M/yy h:mm") +".png")) png.Save(stream);​

    can you help me?

    #2
    You can't have / and : in file names, Windows doesn't allow that. Replace it with - or smth like this.

    Comment


      #3
      Thank you very much, it has worked.

      Comment


        #4
        Hello amir,

        Thanks for your post.

        I am happy to hear you got the code to work.

        Leeroy_Jenkins is correct in the information they provided.

        As Leeroy_Jenkins stated, you could use "-" instead of "/" or ":" in the code you shared.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X