C#: Map screen absolute to relative screen coordinates in multiple screen environment -


One way to map some absolute coordinates (relative to the main screen) to direct me the coordinates for some screens needed.

For example, if you have two screens configured, if the main screen is one of the right, there are some valid negative coordinates that point to the left screen.

Edit: The goal is to know whether some full coordinates are valid on some available screens

  

thanks

div class = "post-text" itemprop = "text">

This should be done for any screen configuration:

  Fixed point GetRelativeCoordinates (points Absolute coordinator) {var screen = Screen.FromPoint (absoluteCoordinates); New point (absolute corridines .x - return to the screens. Bounds complete, absolute coordinates. Y - screen. Bounce top); }   property  top  and  left    store the full coordinate corner of the screen (< Code> [0, 0]  at the top, on the left side of the primary screen) It is very easy to change the full coordinate to the relative, no matter how many screens you have. 

T tested the code but it should work .


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -