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.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by futtrader, Today, 01:16 PM
        0 responses
        4 views
        0 likes
        Last Post futtrader  
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        838 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,294 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Working...
        X