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 / C++ / MFC
  4. Convert mm(millimeter) into pixels for use with TextOut

Convert mm(millimeter) into pixels for use with TextOut

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 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.
  • W Offline
    W Offline
    wasife
    wrote on last edited by
    #1

    I want to draw a string in an SDI using TextOut. But i have co-ordinates in millimeters. How can i convert them into pixels. Help needed urgently...

    M R 2 Replies Last reply
    0
    • W wasife

      I want to draw a string in an SDI using TextOut. But i have co-ordinates in millimeters. How can i convert them into pixels. Help needed urgently...

      M Offline
      M Offline
      Marc Soleda
      wrote on last edited by
      #2

      Ups!! The pixel is the basic unit of programmable color on a display or image so it's more a logical unit than a physical one, altough the physical size of a pixel depends on how you've set the resolution for the display screen: If the display is at its maximum resolution, the physical size of a pixel will be the physical size of the dot of the display (usually .28mm but you should look to the specs of your display). If you've set the resolution to less, a pixel will be larger than the physical size of the screen's dot (the pixel will use more than one dot). Hope it helps ... Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

      1 Reply Last reply
      0
      • W wasife

        I want to draw a string in an SDI using TextOut. But i have co-ordinates in millimeters. How can i convert them into pixels. Help needed urgently...

        R Offline
        R Offline
        RicoH
        wrote on last edited by
        #3

        Hi, If you call 'GetDeviceCaps' on your device context you can get the width and height, in millimeters, of your physical screen. You can also get the resolution of the screen in pixels this way, so you should be able to do some calculations based on these values... Don't think you are, know you are...

        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