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. help with printing please

help with printing please

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
2 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.
  • I Offline
    I Offline
    IGeorgeI
    wrote on last edited by
    #1

    Hi all I have been customizing overridden print methods like onPrepareDc() and print() etc. My programs work but my knowledge is still fuzzy. My question is - can somebody please explain to me the definition and differences between - windowExt - viewportExt - logical units - dots per inch and how these 4 things really interact when it comes to printing. I have checked MFC's documentation and about 4 diff MFC books and the MIcrosoft site. Nobody comes out and defines these things, they all just talk about how to use them. Any help appreciated or just point me to some references please IGeorgeI :confused: George W Software Developer www.zsystems.ca

    P 1 Reply Last reply
    0
    • I IGeorgeI

      Hi all I have been customizing overridden print methods like onPrepareDc() and print() etc. My programs work but my knowledge is still fuzzy. My question is - can somebody please explain to me the definition and differences between - windowExt - viewportExt - logical units - dots per inch and how these 4 things really interact when it comes to printing. I have checked MFC's documentation and about 4 diff MFC books and the MIcrosoft site. Nobody comes out and defines these things, they all just talk about how to use them. Any help appreciated or just point me to some references please IGeorgeI :confused: George W Software Developer www.zsystems.ca

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Device Units / Coordinates: Device units are the actual units of the device context. This would be pixels. Logical Units / Coordinates: Since different devices have different resolutions, windows allows programmers to define Logical units in order to make the graphics programming more device independant. Logical units are also called the page coordinate space. This allows the programmer to define the units that they would like to work with instead of pixels. For instance, say you are writing a landscaping program, you could define the base unit as 1/8 inch. WindowExtent: This is a value that indicates what units that you would like to work with. ViewportExtent: The size of the viewport that the WindowExtent will be mapped to. Say you wanted to make a mini-view of a document, you would set the WindowExtent to the size of the document regularly, and the Viewport extent to the size of the mini view. Then you use the same paint code, and you will have a mini-view of your document. Dots / Inch: This is the resolution of your printer or display device. Usually monitors aren't measured like this so I will explain printers. A fairly standard resolution for printers is 600 dpi, which is 600 dots / inch. You can think of this as 600 pixels / inch. If you left you DC that you received from your printer as the default, you would be painting each individual pixel, but since you set the window extent and the viewport extent, the logical or page coordinates get remapped to allow you to paitn your graphic on the entire page. There is alot of information in MSDN and in Charles Petzolds Windows programming book.

      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