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. Image size and location change at time of printing

Image size and location change at time of printing

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelp
5 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
    Le rner
    wrote on last edited by
    #1

    hi all, i draw a image when i preview it its display ok but at time of printing the image location and size is different. i really don understand whats going wrong here please help me for this. i m using this to draw image.

    Graphics graphics(pDC->GetSafeHdc());
    Image myPNG(path);
    if(myPNG.GetLastStatus()!=Ok)
    {
    return FALSE;
    }

    graphics.DrawImage(&myPNG, (INT)image\_rect.left, (INT)image\_rect.top, 300, 300);
    return TRUE;
    

    thanks in advance.

    L 1 Reply Last reply
    0
    • L Le rner

      hi all, i draw a image when i preview it its display ok but at time of printing the image location and size is different. i really don understand whats going wrong here please help me for this. i m using this to draw image.

      Graphics graphics(pDC->GetSafeHdc());
      Image myPNG(path);
      if(myPNG.GetLastStatus()!=Ok)
      {
      return FALSE;
      }

      graphics.DrawImage(&myPNG, (INT)image\_rect.left, (INT)image\_rect.top, 300, 300);
      return TRUE;
      

      thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your size parameter values need to be scaled for output to a printer. When drawing to the screen 300 is the number of pixels, but when drawing to a printer it is the number of dots. See SetMapMode function (Windows)[^].

      L 2 Replies Last reply
      0
      • L Lost User

        Your size parameter values need to be scaled for output to a printer. When drawing to the screen 300 is the number of pixels, but when drawing to a printer it is the number of dots. See SetMapMode function (Windows)[^].

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        thanks its done.

        1 Reply Last reply
        0
        • L Lost User

          Your size parameter values need to be scaled for output to a printer. When drawing to the screen 300 is the number of pixels, but when drawing to a printer it is the number of dots. See SetMapMode function (Windows)[^].

          L Offline
          L Offline
          Le rner
          wrote on last edited by
          #4

          sir now one more issue occur here when i print with multiple page. on first page its drawimage correctly but after first page it return generic error. i really dont understand what happen here. please help me for this. thanks in advance.

          L 1 Reply Last reply
          0
          • L Le rner

            sir now one more issue occur here when i print with multiple page. on first page its drawimage correctly but after first page it return generic error. i really dont understand what happen here. please help me for this. thanks in advance.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            I suggest you open a new question, and provide proper details of both code and error. You can help to isolate the problem by using your debugger to step through your code.

            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