OVH Cloud OVH Cloud

Utilisation de l'Objet Printer

7 réponses
Avatar
Nicolas Poirier
J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir comment faire?

Merci
Nicolas Poirier

7 réponses

Avatar
ng
Salut,

Essaye ceci :

<code testedúlse>

'//Imprime un texte blanc sur fond gris
Printer.ScaleMode = 3 '//Pixel
Printer.ForeColor = vbWhite
Printer.Line (0, 0)-(Printer.Width, Printer.Height), RGB(128, 128, 128),
BF
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "salut"
Call Printer.EndDoc

</code>

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir comment faire?

Merci
Nicolas Poirier


Avatar
Nicolas Poirier
En fait, j'utilise effectivement la fonction Line pour faire une boîte
grise, puis j'inscris mon texte par dessus.
Le problème est que le fond du texte n'est pas transparent, alors mon texte
produit un carré blanc qui supplante la couleur grise. Bien sûr, comme mon
lettrage est blanc, il n'apparaît pas puisqu'il est alors blanc sur fond
blanc.

Printer.FontTransparent = True
Printer.ColorMode = vbPRCMMonochrome
Printer.Line (0, 0)-(Printer.Width, Printer.Height), QBColor(8),BF
Printer.ForeColor = QBColor(15)
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "Allo!"
Printer.EndDoc

Merci
Nicolas Poirier

"ng" a écrit dans le message de
news:ObMO%23$$
Salut,

Essaye ceci :

<code testedúlse>

'//Imprime un texte blanc sur fond gris
Printer.ScaleMode = 3 '//Pixel
Printer.ForeColor = vbWhite
Printer.Line (0, 0)-(Printer.Width, Printer.Height), RGB(128, 128,


128),
BF
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "salut"
Call Printer.EndDoc

</code>

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

> J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
> Printer.
>
> Jusqu'ici, mes essais n'ont pas porté fruits.
>
> Est-ce que quelqu'un aurait une idée pour savoir comment faire?
>
> Merci
> Nicolas Poirier




Avatar
Marco
Salut,

A mettre dans dans un .bas

'** Corrige un bug pour imprimer les fond en couleurs sur du texte**
'
Public Declare Function SetBkMode Lib "gdi32" (ByVal hDC As Long,
ByValnBkMode As Long) As Long
Public Const OPAQUE = 2
Public Const TRANSPARENT = 1

puis a ceci dans chaque sub ou tu veut imprimer

SetBkMode Printer.hDC, TRANSPARENT

Information receuillie ici, quand j'ai poser moi meme cette qst,encore
merci.


Nicolas Poirier avait écrit le 07/08/2004 :
En fait, j'utilise effectivement la fonction Line pour faire une boîte
grise, puis j'inscris mon texte par dessus.
Le problème est que le fond du texte n'est pas transparent, alors mon texte
produit un carré blanc qui supplante la couleur grise. Bien sûr, comme mon
lettrage est blanc, il n'apparaît pas puisqu'il est alors blanc sur fond
blanc.

Printer.FontTransparent = True
Printer.ColorMode = vbPRCMMonochrome
Printer.Line (0, 0)-(Printer.Width, Printer.Height), QBColor(8),BF
Printer.ForeColor = QBColor(15)
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "Allo!"
Printer.EndDoc

Merci
Nicolas Poirier

"ng" a écrit dans le message de
news:ObMO%23$$
Salut,

Essaye ceci :

<code testedúlse>

'//Imprime un texte blanc sur fond gris
Printer.ScaleMode = 3 '//Pixel
Printer.ForeColor = vbWhite
Printer.Line (0, 0)-(Printer.Width, Printer.Height), RGB(128, 128, 128),
BF
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "salut"
Call Printer.EndDoc

</code>

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir comment faire?

Merci
Nicolas Poirier







--
Ceci est une signature automatique de MesNews.
Site : http://mesnews.no-ip.com
Avatar
>-----Message d'origine-----
Salut,

Essaye plutôt ceci :



'Imprime un texte blanc sur fond gris
Printer.ScaleMode = 1 'Twips
Printer.ForeColor = vbWhite
Mot = "salut, et à bientôt" 'Texte à imprimer
Hauteur = TextHeight(Mot) 'Hauteur du texte en Twips
Largeur = TextWidth(Mot) 'Largeur du texte en Twips
DepL = 1000 'Marge gauche
DepH = 1000 'Marge haute
Printer.Line (DepL, DepH)-(DepL + Largeur, DepH +
Hauteur), &H808080, BF
Printer.CurrentX = DepL
Printer.CurrentY = DepH
Printer.Print Mot
Printer.EndDoc
End
--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

J'aimerais imprimer du texte blanc sur fond gris en




utilisant l'objet
Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir




comment faire?

Merci
Nicolas Poirier




.



Avatar
le_troll
Salut Nicolas, lol, là ça va lui coûter cher en encre RGB(128, 128, 128)...
:o)

--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------


"ng" a écrit dans le message de news:
ObMO#$$
Salut,

Essaye ceci :

<code testedúlse>

'//Imprime un texte blanc sur fond gris
Printer.ScaleMode = 3 '//Pixel
Printer.ForeColor = vbWhite
Printer.Line (0, 0)-(Printer.Width, Printer.Height), RGB(128, 128,


128),
BF
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "salut"
Call Printer.EndDoc

</code>

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

> J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
> Printer.
>
> Jusqu'ici, mes essais n'ont pas porté fruits.
>
> Est-ce que quelqu'un aurait une idée pour savoir comment faire?
>
> Merci
> Nicolas Poirier




Avatar
Nicolas Poirier
Marco aviat raison.
Le bogue en détails:

Microsoft Knowledge Base Article - 145726
Article ID: Q145726
BUG: Setting FontTransparent Has No Effect on Windows 95/98/Me
http://support.microsoft.com/default.aspx?scid=kb;en-us;145726&Product=vst
____________________________

"Nicolas Poirier" a écrit dans le message de
news:dXRQc.48438$
J'aimerais imprimer du texte blanc sur fond gris en utilisant l'objet
Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir comment faire?

Merci
Nicolas Poirier




Avatar
ng
Oui c'est pr ca que je n'ai pas testé hihi :) (et je n'avais pas
d'imprimantes virtuelles isntallées sur ma machine).

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



le_troll a écrit :

Salut Nicolas, lol, là ça va lui coûter cher en encre RGB(128, 128,
128)...
o)




"ng" a écrit dans le message de news:
ObMO#$$
Salut,

Essaye ceci :

<code testedúlse>

'//Imprime un texte blanc sur fond gris
Printer.ScaleMode = 3 '//Pixel
Printer.ForeColor = vbWhite
Printer.Line (0, 0)-(Printer.Width, Printer.Height), RGB(128,
128, 128), BF
Printer.CurrentX = 10
Printer.CurrentY = 10
Printer.Print "salut"
Call Printer.EndDoc

</code>

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



Nicolas Poirier a écrit :

J'aimerais imprimer du texte blanc sur fond gris en utilisant
l'objet Printer.

Jusqu'ici, mes essais n'ont pas porté fruits.

Est-ce que quelqu'un aurait une idée pour savoir comment faire?

Merci
Nicolas Poirier