Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8701041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:18:05+00:00 2026-06-13T02:18:05+00:00

This is useful for me because I have to map objects with a correct

  • 0

This is useful for me because I have to map objects with a correct dimension on screen; if I’m using a 19″ lcd with 1280×1024 resolution and a normal 96dpi setting then in order to map a correct 1-inch square I have to write a xaml like this

<Rectangle Name="one_inch_side_on_19_inch_diag_display" Height="86" Width="86" Fill="Blue"/>

where Width and Height are put to 86 because

86 ~= 96 (dots-per-inch) * 17 (inches) / 19 (inches)

as windows assumes 96dpi on a 17″ monitor as the base to calculate dimensions…
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:18:06+00:00Added an answer on June 13, 2026 at 2:18 am

    I found a similar question on http://www.c-sharpcorner.com. It provides below code

    using System;
    using System.Management;
    
    class Test
    {
        static void Main()
        {
           var searcher = new ManagementObjectSearcher("\\root\\wmi","SELECT * FROM WmiMonitorBasicDisplayParams");
    
           foreach(ManagementObject mo in searcher.Get())
           {
               double width = (byte)mo["MaxHorizontalImageSize"] / 2.54; 
               double height = (byte)mo["MaxVerticalImageSize"] / 2.54; 
               double diagonal = Math.Sqrt(width * width + height * height);
               Console.WriteLine("Width {0:F2}, Height {1:F2} and Diagonal {2:F2} inches", width, height, diagonal);            
           }
    
           Console.ReadKey();
        }
    }
    

    I tested it on my local machine which has 2 monitors and it return almost accurate result. (12.70 for my 13 inches and 23.98 for 24 inches screen.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me say I have read this useful article thoroughly and am using
This is not 100% programming related. But I think this is somewhat useful because
Disclaimer : I kept this because some things may be useful to others, however,
Because this is my first attempt at an extension method that seems quite useful
I currently have this useful code that I found elsewhere on StackOverflow: form.DrawToBitmap(bmp, new
I have found this answer really useful. It helps me plot network/graphs and select
I have been searching for hours and haven't found anything useful because all other
I have a Domain that I generate using Entity Developer. This creates all of
I've used this useful JQuery function that serializes nested elements. the problem is how
I am making a menu for an app and was pointed to this useful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.