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. why can't I print an icon?

why can't I print an icon?

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

    I want to print some icons. Here is my code:

    CDC* m_PrintDC;
    // attach m_PrintDC with printer success .....

    CPoint point(10, 10);
    HICON aIcon = AfxGetApp()->LoadIcon(IDI_ICON_CHECKEDBOX);
    m_PrintDC->DrawIcon(point, aIcon);

    //m_PrintDC->DrawText("xxxxxxxxx", &aRect,DT_SINGLELINE | DT_LEFT);

    Here IDI_ICON_CHECKEDBOX is a icon ID that I draw. But it doesn't work, I don't know why?? I can print some text with DrawText(...). Anyone know what's wrong here? Thank you in advance.

    M 1 Reply Last reply
    0
    • T tataxin

      I want to print some icons. Here is my code:

      CDC* m_PrintDC;
      // attach m_PrintDC with printer success .....

      CPoint point(10, 10);
      HICON aIcon = AfxGetApp()->LoadIcon(IDI_ICON_CHECKEDBOX);
      m_PrintDC->DrawIcon(point, aIcon);

      //m_PrintDC->DrawText("xxxxxxxxx", &aRect,DT_SINGLELINE | DT_LEFT);

      Here IDI_ICON_CHECKEDBOX is a icon ID that I draw. But it doesn't work, I don't know why?? I can print some text with DrawText(...). Anyone know what's wrong here? Thank you in advance.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      What's the dpi on the printer DC? A 32x32 icon will be pretty small on a 1400dpi printer :)

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      B 1 Reply Last reply
      0
      • M Mark Salsbery

        What's the dpi on the printer DC? A 32x32 icon will be pretty small on a 1400dpi printer :)

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        B Offline
        B Offline
        Bram van Kampen
        wrote on last edited by
        #3

        Yes, without other mapping, about 0.023 inch per side.The final rendering software may pass that off as noise and decide to print a blank page. :) Regards :)

        Bram van Kampen

        T 1 Reply Last reply
        0
        • B Bram van Kampen

          Yes, without other mapping, about 0.023 inch per side.The final rendering software may pass that off as noise and decide to print a blank page. :) Regards :)

          Bram van Kampen

          T Offline
          T Offline
          tataxin
          wrote on last edited by
          #4

          thank you for your reply! my printer is HP LaserJet 3052, with 1200dpi. So do you have any idea what I should do in this case?

          B 1 Reply Last reply
          0
          • T tataxin

            thank you for your reply! my printer is HP LaserJet 3052, with 1200dpi. So do you have any idea what I should do in this case?

            B Offline
            B Offline
            Bram van Kampen
            wrote on last edited by
            #5

            Create a New Bitmap of fixed dimensions of your choice, Bitbuild your Icon in it, using stretch mode, and then print this new bitmap. Regards, :)

            Bram van Kampen

            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