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 mintos, 04-02-2024, 08:22 PM
      4 responses
      29 views
      0 likes
      Last Post mintos
      by mintos
       
      Started by Felix Reichert, 04-26-2024, 02:12 PM
      10 responses
      69 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by PaulMohn, 04-24-2024, 03:49 AM
      4 responses
      36 views
      0 likes
      Last Post PaulMohn  
      Started by lightsun47, Today, 11:37 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by vitaly_p, Yesterday, 05:09 PM
      4 responses
      36 views
      0 likes
      Last Post vitaly_p  
      Working...
      X