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. Watermark printing

Watermark printing

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • H Offline
    H Offline
    Harsh Shankar
    wrote on last edited by
    #1

    hi guys, In my current assignment, i am looking to print watermark on the page as per the type of the page, say on the introduction page i wish a watermark of "INTRODUCTION". i firstly tried some googling. but so far no lucks :((.. I guess i am clear what i need.. any body please help..

    HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

    L 1 Reply Last reply
    0
    • H Harsh Shankar

      hi guys, In my current assignment, i am looking to print watermark on the page as per the type of the page, say on the introduction page i wish a watermark of "INTRODUCTION". i firstly tried some googling. but so far no lucks :((.. I guess i am clear what i need.. any body please help..

      HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

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

      Well I guess the best thing to do would be to add some code to your print routine to overlay your printed page with the word "INTRODUCTION" in light gray or some other colour of your choosing.

      txtspeak is the realm of 9 year old children, not developers. Christian Graus

      H 1 Reply Last reply
      0
      • L Lost User

        Well I guess the best thing to do would be to add some code to your print routine to overlay your printed page with the word "INTRODUCTION" in light gray or some other colour of your choosing.

        txtspeak is the realm of 9 year old children, not developers. Christian Graus

        H Offline
        H Offline
        Harsh Shankar
        wrote on last edited by
        #3

        Hi, First of all thanx replying Richard, Well if i'll pring or draw something and then if something will come over it, it will be gone. Even Suppose I'll make the impression of "INTRODUCTION" on the DC and in some next step i'll draw a text like "abc<10-20spaces>xyz", what ever will be written bellow the white spaces will again be gone.. I hope you got the problem

        HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

        L L 2 Replies Last reply
        0
        • H Harsh Shankar

          Hi, First of all thanx replying Richard, Well if i'll pring or draw something and then if something will come over it, it will be gone. Even Suppose I'll make the impression of "INTRODUCTION" on the DC and in some next step i'll draw a text like "abc<10-20spaces>xyz", what ever will be written bellow the white spaces will again be gone.. I hope you got the problem

          HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

          L Offline
          L Offline
          loyal ginger
          wrote on last edited by
          #4

          You can draw the superimposed text last, using a mode that only draws the text but keep the background transparent. SetBkMode(TRANSPARENT) will do the trick. The above superimposed text will block whatever behind it because the superimposed text is opaque. To make a true superimposed text, you have to make them semi-transparent. To achieve this, you need to use a certain way to blend the text to the existing drawings. This is more complicated. You may need to create a couple of image buffers to conduct these operations, and print the final result. -modification- As Richard MacCutchan pointed out, you can print your superimposed text first, then render everything else. When you render text, make sure the background mode is set to transparent. That way, only the text itself is rendered, the background will be see-through. Your problem is probably caused by the fact that the background mode is not set to transparent. Check the documentation out: http://msdn.microsoft.com/en-us/library/dd162965(VS.85).aspx[^]

          modified on Thursday, February 11, 2010 9:37 AM

          1 Reply Last reply
          0
          • H Harsh Shankar

            Hi, First of all thanx replying Richard, Well if i'll pring or draw something and then if something will come over it, it will be gone. Even Suppose I'll make the impression of "INTRODUCTION" on the DC and in some next step i'll draw a text like "abc<10-20spaces>xyz", what ever will be written bellow the white spaces will again be gone.. I hope you got the problem

            HARSH Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.

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

            Harsh Shankar wrote:

            what ever will be written bellow the white spaces will again be gone..

            I don't think this is strictly true; when you print on a DC only the colours are rendered so all white space remains as it was. Thus if you print your watermark first and then your text on top, only the parts of the watermark that get overprinted will disappear. Why not try a small test to see what results you might get?

            txtspeak is the realm of 9 year old children, not developers. Christian Graus

            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