REQ: Font isn't transparant on Printer object in VB 5.0 
Author Message
 REQ: Font isn't transparant on Printer object in VB 5.0

Hello

I hope someone can help me with this question:

I can not print fonts with a transparent background.

I have to print a box which is filled with the color yellow and then print
some text (which is black) within this yellow box. Instead of printing this
correctly, a white space around the characters is printed. (I do set the
Transparent attribute of the font to True!)
When I try to do the same on a picture control every thing works correctly,
so what am I doing wrong?

If anyone has got a solution to this problem, could you please send me a
mail, or post it?

Thanks in advance,




Sun, 12 Dec 1999 03:00:00 GMT  
 REQ: Font isn't transparant on Printer object in VB 5.0


Quote:
>Hello

>I hope someone can help me with this question:

>I can not print fonts with a transparent background.

>I have to print a box which is filled with the color yellow and then print
>some text (which is black) within this yellow box. Instead of printing this
>correctly, a white space around the characters is printed. (I do set the
>Transparent attribute of the font to True!)
>When I try to do the same on a picture control every thing works correctly,
>so what am I doing wrong?

>If anyone has got a solution to this problem, could you please send me a
>mail, or post it?

Yes it is one of the many printer bugs of Visual Basic. You should
change the attribute not changing the property of printer object, but
calling API function as following:

Private Sub Font_Transparent(Mode As Boolean)
''imposta VERAMENTE prop. fonttransparent di Printer
iBKMode = SetBkMode(Printer.hdc, IIf(Mode, TRANSPARENT, OPAQUE))
End Sub

    Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long,
ByVal nBKMode As Long) As Long
    Private iBKMode As Long             ''per ovviare al bug MS della
proprieta'
    Private Const TRANSPARENT = 1       ''fonttransparent
    Private Const OPAQUE = 2

Try and let me know if it works...

Stefano - 53.6%

http://www.geocities.com/SiliconValley/Lakes/1218
(programmazione VB 32 bit)
Quake Nickname: The-Nerd



Sun, 12 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Why isn't VB object oriented

2. font transparent on printer object doesn't work

3. VB 5.0 Printer.Textwidth problems on small fonts

4. Why printer object won't stay reset to correct font/size

5. Printer Object VB4 still don't set Font Size - PLEASE HELP

6. Word isn't loading my fonts...

7. after pdf Export with Crystal - pdf File isn't able to use default Font

8. Printer object and printer fonts

9. Does DrawWidth work in VB 5.0 Printer Object ????

10. Changing Font with Printer-object VB.4.0 Pro Win95

11. Help, bug in VB 5.0 printer object !!

12. VB Printer Object with a LinePrinter Font

 

 
Powered by phpBB® Forum Software