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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Creating Device Context

Creating Device Context

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphics
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.
  • L Offline
    L Offline
    Larry J Siddens
    wrote on last edited by
    #1

    Question: Can a Device Context be created by hand for a imaginary device? Reason: I am creating an application that will be outputting (drawing) to an image device that does not have a physical Device (like a printer). I would like to create this DC so that when I do calls like: LPtoDP or DPtoLP or even doing a line MoveTo( DC, point) and a line LineTo( DC, point) that I don't have to calculate the difference. In a 1200 dpi printer, and you want to draw a 1" x 1" rectangle you create the rectange (based upon your mapping mode, in this case we will use LOENGLISH) Rect( 100, 100, 200, 200 ) -> 1x1 rectangle starting at 1 inch from the top and left. So in a 1200 dpi this converts to 1200, 1200, 2400, 2400 in the actual drawing. I would like to be able to create a dc that does not connect to a physical device with a dpi say 350x350. How can this be done? AND, can it be done? Thanks Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

    PJ ArendsP 1 Reply Last reply
    0
    • L Larry J Siddens

      Question: Can a Device Context be created by hand for a imaginary device? Reason: I am creating an application that will be outputting (drawing) to an image device that does not have a physical Device (like a printer). I would like to create this DC so that when I do calls like: LPtoDP or DPtoLP or even doing a line MoveTo( DC, point) and a line LineTo( DC, point) that I don't have to calculate the difference. In a 1200 dpi printer, and you want to draw a 1" x 1" rectangle you create the rectange (based upon your mapping mode, in this case we will use LOENGLISH) Rect( 100, 100, 200, 200 ) -> 1x1 rectangle starting at 1 inch from the top and left. So in a 1200 dpi this converts to 1200, 1200, 2400, 2400 in the actual drawing. I would like to be able to create a dc that does not connect to a physical device with a dpi say 350x350. How can this be done? AND, can it be done? Thanks Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      I believe what you want is a metafile DC. If you are using MFC have a look at CMetaFileDC. I have never used it myself, so I may be totally off base here.


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      Within you lies the power for good; Use it!

      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