• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Image (png) on Chart

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

    Draw Image (png) on Chart

    Hello,

    I'm trying to load an image from file and display it on the chart; a company logo.

    Using the example NinjaJess posted here, I am getting an exception "Unsupported Pixel Format." I have connected with the debugger and changed to the PixedFormat that RenderTarget is using, but the same exception persists.

    Any light you may be able to shed would be helpful.

    Thank you
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    #2
    Hello mrlogik,

    Thanks for opening the thread.

    I recently made some changes to the example Jesse posted to dispose of any resources needed to create the bitmap on RenderTarget changes and on the indicator's termination.

    Attached is an updated example. If you are still able to encounter issues with this script, could you provide us some steps we could take to reproduce on our end?

    We are happy to look into this further as needed.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Works perfectly, thank you Jim
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        Thank you Jim.

        How can I test if the file exists?

        In NT7 all is very easy with Drawing and Drawing2D namespaces, but in NT8 are limited !? why?

        I cant use the simple code: if (File.Exists(@"C:\Users\Public\signal_short.wav") ...

        Comment


          #5
          Hello ninjo,

          File.Exists would be included with System.IO. You will need to add a using statement to use System.IO with your script. An example that uses System.IO with NT8 can be found below.

          https://ninjatrader.com/support/help..._propertie.htm

          Let us know if you have any questions.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ninjo, Today, 11:54 AM
          0 responses
          1 view
          0 likes
          Last Post ninjo
          by ninjo
           
          Started by deblanka, Today, 08:56 AM
          0 responses
          6 views
          0 likes
          Last Post deblanka  
          Started by Boonfly8, Yesterday, 12:30 PM
          7 responses
          18 views
          0 likes
          Last Post sledge
          by sledge
           
          Started by Sohal, Today, 05:02 AM
          2 responses
          13 views
          0 likes
          Last Post techmint  
          Started by danitralla, Today, 03:33 AM
          0 responses
          5 views
          0 likes
          Last Post danitralla  
          Working...
          X