Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help Draw image

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

    Help Draw image

    Hello.
    As it can be implemented in version 8?

    Thanks, Andrey I.

    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    {
    Image img = Image.FromFile(Environment.GetFolderPath(Environme nt.SpecialFolder.Personal) + \\logo.png");
    graphics.DrawImage(img, 1, 18, 50, 50);
    }

    #2
    Hello,

    Thank you for the question.

    Because NinjaTrader 8 now uses SharpDX, quite a lot has changed in regard to how you would Draw an image.

    I located a SharpDX sample of drawing an image specifically using Google: https://english.r2d2rigo.es/2014/08/...using-sharpdx/

    Most items you will research for SharpDX will not be specific to NinjaTrader so you would need to take whatever examples you find and review the logic used and only use exactly what is needed.

    This page linked to a git repo which contained a sample, I reviewed the sample and took only the critical parts from that sample and placed them in an indicator which is attached.
    https://github.com/r2d2rigo/Direct2D...iewProvider.cs

    NinjaTrader does most of the hard work so most of the sample was not used, only the loading the file and drawing were taken from the sample.

    For other NInjaTrader Specific examples of SharpDX, I would suggest reviewing the SampleCustomPlot indicator or any of the Drawing Tools that are in the NinjaScript editor as they all use OnRender.

    To run the sample, Import the indicator. After importing the indicator, place the attached image in the Documents\NinjaTrader 8 folder. The indicator is specifically looking for the User documents folder to load the image from file.

    Please let me know if I may be of further assistance.

    Attached Files
    Last edited by NinjaTrader_ChelseaB; 10-31-2022, 10:19 AM.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RDTrader16, Today, 10:19 PM
    0 responses
    2 views
    0 likes
    Last Post RDTrader16  
    Started by gemify, 03-08-2023, 08:02 AM
    9 responses
    148 views
    0 likes
    Last Post culpepper  
    Started by elirion, Today, 10:03 PM
    0 responses
    1 view
    0 likes
    Last Post elirion
    by elirion
     
    Started by RaddiFX, Today, 09:55 PM
    0 responses
    6 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by Trader146, 03-29-2024, 01:22 PM
    4 responses
    25 views
    0 likes
    Last Post Trader146  
    Working...
    X