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. Printing an icon....

Printing an icon....

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • N Offline
    N Offline
    Neha
    wrote on last edited by
    #1

    Hi, How can I print the icon? DrawIcon()doesn't work with printer dc... Regards Neha

    M R 2 Replies Last reply
    0
    • N Neha

      Hi, How can I print the icon? DrawIcon()doesn't work with printer dc... Regards Neha

      M Offline
      M Offline
      Manikandan
      wrote on last edited by
      #2

      u can find nice stuff under bitmaps & palettes section...my favorite is Davide Pizzolato...

      1 Reply Last reply
      0
      • N Neha

        Hi, How can I print the icon? DrawIcon()doesn't work with printer dc... Regards Neha

        R Offline
        R Offline
        Roger Allen
        wrote on last edited by
        #3

        THis is the way I do it:

        // now render the icon
        int xSize = (pDC->GetDeviceCaps(LOGPIXELSX) \* 16) / 96;			// a screen display gives us 96dpi, scale the same for device(s)
        int ySize = (pDC->GetDeviceCaps(LOGPIXELSY) \* 16) / 96;
        ::DrawIconEx(pDC->m\_hDC, x - (xSize / 2), y - (ySize / 2), m\_pTemplate->GetIcon(), xSize, ySize, 0, NULL, DI\_IMAGE | DI\_MASK);
        

        This will scale correctly for a preview and a print. although I have seen problems on some printers etc which do not use the mask correctly :( Roger Allen - Sonork 100.10016 Strong Sad: Clever I am? Next to no one. Undiscovered and soggy. Look up. Look down. They're around. Probably laughing. Still, bright, watery. Listed among the top. Ten. Nine. Late night. Early morn. Early mourn. Now I sleep.

        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