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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        47 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        141 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        275 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X