Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Adding Graphic Image to Chart

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

    Adding Graphic Image to Chart

    Hey there.

    I'd like to add a graphic watermark on my charts. I have a PNG, is there any way to add this? Or a way to generate the SharpDX vectors to render it?

    Thank you

    Kevin

    #2
    Hello reach4thelasers,

    Thanks for opening the thread.

    This can be done using SharpDX and drawing an image within OnRender().

    Although created for bitmaps and not PNG's, we do have sample code that you can reference for how to do this. I will attach the sample to my post.

    Please let me know if I may be of further assistance.
    Attached Files
    Last edited by NinjaTrader_Jim; 11-12-2018, 08:47 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      I know it's been just over two years!

      How would you go about converting the image to grayscale? I tried changing PixelFormat but SharpDX was giving me a formatting error. I had a look over at SOF and read SharpDx will not render Grayscale (8dpp ??), but instead I have to use a shader. Any help on that would be great.
      I am currently making a 2D application using SharpDX.Direct2D1. Here is my setup for my 2D deviceContext that works correctly. m_swapchaindesc = New SwapChainDescription() With m_swapchainde...

      Comment


        #4
        Hello sim22,

        This would be more of a general C# concept than NinjaScript related and beyond the complexity of what we can support.

        I would suggest you continue to search the sites you've linked to for the answer.

        Please let us know if you need a third party to assist you with this.

        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Thank you. Don't expect much and you won't be disappointed.

          Comment


            #6
            Hello Sim22,

            I was able to find the following with a simple web search,
            Is there a way to convert an image to grayscale 16 bits per pixel format, rather than setting each of the r,g and b components to luminance. I currently have a bmp from file. Bitmap c = new Bitmap("


            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              is that available for NT7?

              Comment


                #8
                Hello TazoTadoa,

                We don't have an example for drawing bitmaps in NinjaTrader 7 and we do not offer support for using System.Drawing or the Plot method which would be the parallel to NinjaTrader 8's OnRender().

                A client previously was asking about drawing bitmaps in NinjaTrader 8 in reference to a script that already does this for NinjaTrader 7. Their attached script may help you out further, so I'll include a link below.

                https://ninjatrader.com/support/foru...cyback-for-nt8

                Please let us know if you have any additional questions.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bill2023, Yesterday, 08:51 AM
                8 responses
                43 views
                0 likes
                Last Post bill2023  
                Started by yertle, Today, 08:38 AM
                6 responses
                25 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                24 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                16 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                46 views
                0 likes
                Last Post jeronymite  
                Working...
                X