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. Dpi

Dpi

Scheduled Pinned Locked Moved C#
graphicsquestion
4 Posts 4 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.
  • K Offline
    K Offline
    Kordzik
    wrote on last edited by
    #1

    I need to make some calculations from milimetres to pixels in my programme (for drawing) and I need a Dots-per-inch current value for this. Where can I get it? Supposedly in the WMI:) but isn't there a class which handles this in standard libraries by any chance? (It would even better if DirectDraw objects could perform drawing operations using milimetres coordinates, but I highly doubt it can be made:)

    C G 2 Replies Last reply
    0
    • K Kordzik

      I need to make some calculations from milimetres to pixels in my programme (for drawing) and I need a Dots-per-inch current value for this. Where can I get it? Supposedly in the WMI:) but isn't there a class which handles this in standard libraries by any chance? (It would even better if DirectDraw objects could perform drawing operations using milimetres coordinates, but I highly doubt it can be made:)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I thought GDI+ allowed you to set drawing units as inches ? Christian Graus - Microsoft MVP - C++

      S 1 Reply Last reply
      0
      • C Christian Graus

        I thought GDI+ allowed you to set drawing units as inches ? Christian Graus - Microsoft MVP - C++

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

        You can indeed set drawing units as inches (System.Drawing.GraphicsUnit.Point is 1/72 inch). Plus, you can get the DPI values from the System.Drawing.Graphics.DpiX and DpiY properties.

        1 Reply Last reply
        0
        • K Kordzik

          I need to make some calculations from milimetres to pixels in my programme (for drawing) and I need a Dots-per-inch current value for this. Where can I get it? Supposedly in the WMI:) but isn't there a class which handles this in standard libraries by any chance? (It would even better if DirectDraw objects could perform drawing operations using milimetres coordinates, but I highly doubt it can be made:)

          G Offline
          G Offline
          gaby2r
          wrote on last edited by
          #4

          you can use the folowing function to make calculations and transformations betwin different coordonating spaces Graphics.TransformPoints

          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