PDA

Click to See Complete Forum and Search --> : printing problem


Tonatiuh
Aug 14th, 2000, 05:56 PM
I'm using the SetBkMode APi to turn transparent the printer font. It functions very well in almost all printers when the application is working on Win9x. But when the same app is working on WinNT this API doesn't work.

This is the code I use:

iBKMode = SetBkMode(Printer.hdc, TRANSPARENT)

Where TRANSPARENT constant is equal to 1.

The Printer.FontTransparent that comes in VB doesn't function.

Any idea about this?

gfrench
Aug 24th, 2000, 05:51 PM
What is the return value from the API call?

I'll try my best

Tonatiuh
Aug 25th, 2000, 08:27 AM
I don't know. This problem just has presented in a pair of computers where I installed only the executable. I have found that is not only in WinNT, because there are some NT OS where it works fine.

Any idea about the diferent values it can return?

gfrench
Aug 25th, 2000, 04:22 PM
If the return value is none-zero it means that the function has failed. If it has failed that would explaain why it is not working, if it has succeeded then the problem lies else where.


Grant French

e-mail: grant.french@libertysurf.co.uk
ICQ: 33122184

parksie
Aug 25th, 2000, 04:25 PM
The SDK says this:

Parameters
hdc
[in] Handle to the device context.
iBkMode
[in] Specifies the background mode. This parameter can be one of the following values. Value Description
OPAQUE Background is filled with the current background color before the text, hatched brush, or pen is drawn.
TRANSPARENT Background remains untouched.


Return Values
If the function succeeds, the return value specifies the previous background mode.

If the function fails, the return value is zero.

Windows NT/ 2000: To get extended error information, call GetLastError.

Remarks
The SetBkMode function affects the line styles for lines drawn using a pen created by the CreatePen function. SetBkMode does not affect lines drawn using a pen created by the ExtCreatePen function.

The iBkMode parameter can also be set to driver-specific values. GDI passes such values to the device driver and otherwise ignores them.

gfrench
Aug 25th, 2000, 04:30 PM
Sorry i got it the wrong way round. Thankyou Parksie for correcting me.