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 llanqui, Today, 03:53 AM
        0 responses
        2 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X