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

Clarification on DPI and Device Independent Pixels

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

    Clarification on DPI and Device Independent Pixels


    clickPoint.X = ChartingExtensions.ConvertToHorizontalPixels(click Point.X, chartControl.PresentationSource);
    clickPoint.Y = ChartingExtensions.ConvertToVerticalPixels(clickPo int.Y, chartControl.PresentationSource);

    Hello i just wanted to clarify and confirm the use of the above helper methods as covered in the NT8 help.

    From my useage of the above it has been more confined to when i capture mouse clicks on the chart and then convert before rendering on the chart canvas.
    Is this the main use in ninja for this for handling mouse events ?

    Generally drawing in OnRender with Sharpdx that is just drawing point to point in the code doesnt require this ? Ie the horizontal and vertical pixels for these methods is the same in the ninja chart canvas ( ie device independent pixels) ?

    Was reading up on this topic more and just had a few questions on this.

    thanks

    #2
    Hello explorer101, thanks for your post.

    Device pixels are the physical pixes on the computer. Application pixels are more of a unit of measurement, so when rasterization of the graphics occurs, all of the graphics will be in the correct location. So if a developer used device coordinates on a 1k display, and a user runs the script on a 4k display, it would be in the incorrect location hence you need to develop using application coordinates.

    Please let me know if this does not resolve your inquiry.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      All clear you are essentially saying what the Microsoft articles are saying and confirms my understanding
      thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mongo, Today, 11:05 AM
      0 responses
      1 view
      0 likes
      Last Post Mongo
      by Mongo
       
      Started by Tim-c, Today, 10:58 AM
      0 responses
      1 view
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by traderqz, Yesterday, 09:06 AM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_ThomasC  
      Started by f.saeidi, Today, 10:19 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by kujista, Today, 06:23 AM
      5 responses
      18 views
      0 likes
      Last Post kujista
      by kujista
       
      Working...
      X