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. Bitmap print problem

Bitmap print problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpgraphicsquestion
7 Posts 4 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
    lisoft
    wrote on last edited by
    #1

    I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview. Can you help me? Thanks:((

    C Y R 3 Replies Last reply
    0
    • L lisoft

      I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview. Can you help me? Thanks:((

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      What's the problem ? Is the bitmap really tiny ? If so, you need to get the size of the printer DC and stretchblt your image onto it. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      L 1 Reply Last reply
      0
      • C Christian Graus

        What's the problem ? Is the bitmap really tiny ? If so, you need to get the size of the printer DC and stretchblt your image onto it. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        L Offline
        L Offline
        lisoft
        wrote on last edited by
        #3

        No, the image size is ok and the print preview works quite well, but it did not appear on the actual paper (bitmap lost).

        1 Reply Last reply
        0
        • L lisoft

          I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview. Can you help me? Thanks:((

          Y Offline
          Y Offline
          Yulianto
          wrote on last edited by
          #4

          What`s the code? What`s the problem? You couldn`t use the same CDC for printing bitmap with the CDC for printing lines and words.


          Work hard and a bit of luck is the key to success.

          You don`t need to be genius, to be rich.

          1 Reply Last reply
          0
          • L lisoft

            I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview. Can you help me? Thanks:((

            R Offline
            R Offline
            rw104
            wrote on last edited by
            #5

            I expect that the bitmap is tiny on the print out? is this what is happening? if so it is because you are drawing the bitmap into a printing device context, in which case a much higher resolution is used, you need to use the CDC function StretchBlt() to draw the bitmap into a resolution equivalent rectangle which you will need to work out. So look up StretchBlt()on MSDN its is very simple.!! this function simply stretches the bits in the bitmap accordingly. Print preview probably works because it uses a screen DC just like what you are drawing on. P.S. I hope this is the problem you are getting, if not soz!! :-D

            R L 2 Replies Last reply
            0
            • R rw104

              I expect that the bitmap is tiny on the print out? is this what is happening? if so it is because you are drawing the bitmap into a printing device context, in which case a much higher resolution is used, you need to use the CDC function StretchBlt() to draw the bitmap into a resolution equivalent rectangle which you will need to work out. So look up StretchBlt()on MSDN its is very simple.!! this function simply stretches the bits in the bitmap accordingly. Print preview probably works because it uses a screen DC just like what you are drawing on. P.S. I hope this is the problem you are getting, if not soz!! :-D

              R Offline
              R Offline
              rw104
              wrote on last edited by
              #6

              Soz!,other replies were not there when I replied, Im just not quick enough, well I was eating lunch!!:~

              1 Reply Last reply
              0
              • R rw104

                I expect that the bitmap is tiny on the print out? is this what is happening? if so it is because you are drawing the bitmap into a printing device context, in which case a much higher resolution is used, you need to use the CDC function StretchBlt() to draw the bitmap into a resolution equivalent rectangle which you will need to work out. So look up StretchBlt()on MSDN its is very simple.!! this function simply stretches the bits in the bitmap accordingly. Print preview probably works because it uses a screen DC just like what you are drawing on. P.S. I hope this is the problem you are getting, if not soz!! :-D

                L Offline
                L Offline
                lisoft
                wrote on last edited by
                #7

                I do use the StretchBlt to copy bitmap from memory dc to the actual dc I got from CPrintDlg::CreateDC(), I think may be the problem is the image I want to print is colored, and the device is just only a black-white printer.

                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