How do I write a transparent text (watermark) on a printer DC?

nsanga
nsanga used Ask the Experts™
on
Hi experts,
I would like to print a file. I am creating a DC and rendering the image of a file using some APIs provided by the third party libraries. At this point of time, I would like to render the watermark text. How do I do it? Please help me.

Regards,
Narahari Sanga
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This you can achive by using the Raster operation drawind

Use function SetROP2 with draw mode R2_MASKPEN

eg

SetROP2(hPrinterDC, R2_MASKPEN);
SetBkMode(hPrinterDC, TRANSPARENT);

DrawText(hPrinterDC, ...............);


Good Luck

Author

Commented:
Hi roshmon,
Thank you for your suggestions and the sample code.
I just tried it and still the text is not transparent.
I was told by colleague that one has to create a BMP out of the watermark text and place the BMP in the transparent mode on the printer DC.

Please let me know if you have already know about it

Regards,
Narahari Sanga
That also possible,

try to draw that BMP using blitting function

MaskBlt


Roshmon
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Author

Commented:
Roshmon,
Can you please provide a sample example if possible.

Regards,
Narahari Sanga
Hi,

You can try either

http://www.codeproject.com/bitmap/maskblt.asp


or the MSDN document

"Transparent Blts in Windows NT"

Good Luck

Commented:
hi sanga.
i have the full source code on your requirement.
my source code supports for aalmost all printers.
it will print the watermark in back ground.

but now i can't tell u the answer.
if u want the source it will be some cost

my email account is

venkaiah_79@yahoo.co.in
Hi venkaiah,

      This site is for knowledge transfer. You can share knowledge, but not sell. Please....

Roshmon

Author

Commented:
Hi Roshmon,
I appreciate your kind help and also for the links. It seems, the text strokes are not transparent with the suggestions you have provided. I would like to make the watermark text to merge with the underlying printer Dc and the should be transparent. In other words, the water mark text strokes should be transparent. Please let me know if you know about it. Once again, thanks a lot for your kind co-operation.

Venkaiah,
Thank you for your comments. I am working for a company. I may not pursue your deal. Please let me know the information which can share with us.

Regards,
Narahari Sanga
Author of the Year 2009
Commented:
You will need to generate a bitmap of the text, and twhen you BitBlt it, use the ROP of MERGEPAINT

-- Dan

Author

Commented:
Dear Support Team,
Please close this question as I didn't get information to resolve my problem

Regards,
Narahari Sanga
Author of the Year 2009

Commented:
nsanga,
Did you try any of the BitBlt technoques described?  Any any case, if you don't know how to close a question, please read all of this:
                  http://www.cityofangels.com/Experts/Closing.htm

Author

Commented:
DanRollins ,
Thank you.

I just posted a message to close.

Regards,
Narahari Sanga

Author

Commented:
DanRollins,
I tried BitBlt. However, it didn't work.

We have supported drawing an outline text and a pattern text as watermark after rendering the image on to the printer DC

Regards,
Narahari Sanga

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial