Announcement

Collapse
No announcement yet.

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.

    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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X