DPI question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ankita21
    New Member
    • Jul 2010
    • 3

    DPI question

    how to get current DPI in .net code with C#
    pl. reply me as soon as possible if anybody can help me...
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    Try something like this (if you're working with Windows Forms)

    Code:
    using (Graphics gfx = this.CreateGraphics()) 
    {
    	MessageBox.Show("DpiX: " + gfx.DpiX.ToString() + ", DpiY: " + gfx.DpiY.ToString());
    }

    Comment

    Working...