Created
July 25, 2016 17:43
-
-
Save Boggartfly/9f035f9fa8610d6108fa5c5217bce672 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graphics = Graphics.FromHwnd(IntPtr.Zero); // This gets the graphics configuration of the current screen | |
var scaleX = graphics.DpiX / 96; // 96 was our standard design DPI, remember? | |
var scaleY = graphics.DpiY / 96; | |
this.button1.Location = new System.Drawing.Point((int)Math.Round(20 * scaleX), (int)Math.Round(20 * scaleY)); | |
this.button2.Location = new System.Drawing.Point((int)Math.Round(30 * scaleX), (int)Math.Round(30 * scaleY)); | |
//Use this with C# and change x,y values. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment