Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Dealing with dpi

Dealing with dpi

Scheduled Pinned Locked Moved C#
graphicshelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sgatto159
    wrote on last edited by
    #1

    Hi all, can someone post a snippet of code that draws a rectangle of 2x3 inches ? I mean something that on every Graphics (and then with every sort of dpi) is 2x3 inches. I'm getting mad whit this.... please help ! thanks.

    D 1 Reply Last reply
    0
    • S sgatto159

      Hi all, can someone post a snippet of code that draws a rectangle of 2x3 inches ? I mean something that on every Graphics (and then with every sort of dpi) is 2x3 inches. I'm getting mad whit this.... please help ! thanks.

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      I don't see how that would even be possible. To do it, in addition to knowing the size and type of a monitor to get the approximate screen size (ie 17" crt is about 16" usable), you'd need to know the exact position they adjusted the hieght and width controls to. Beyond that, if you did do this you'd create something that was completely unusable for anyone who, for bragging rights or due to poor vision, is using a projection screen as a primary display.

      S 1 Reply Last reply
      0
      • D Dan Neely

        I don't see how that would even be possible. To do it, in addition to knowing the size and type of a monitor to get the approximate screen size (ie 17" crt is about 16" usable), you'd need to know the exact position they adjusted the hieght and width controls to. Beyond that, if you did do this you'd create something that was completely unusable for anyone who, for bragging rights or due to poor vision, is using a projection screen as a primary display.

        S Offline
        S Offline
        sgatto159
        wrote on last edited by
        #3

        I don't see why not. Infact, I've found how to do it: g.PageUnit = GraphicsUnit.Millimeter; g.DrawRectangle(Pens.Black, 50, 50, 50, 50); does exactly what I need: without care of dpi draws in inches/millimeters/whatever.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups