1 - Imprimir o Texto com a fonte preta com o fundo cinza e tá saindo o texto com a fonte preta e o fundo em branco;
2 - o tom de cinza que eu consegui é muito intenso como faço para conseguir um cinza mais brando, tipo 25% do que eu conseguir.
Código: Selecionar todos
#define FORM_A4 9
#define RGB( nR,nG,nB ) ( nR + ( nG * 256 ) + ( nB * 256 * 256 ) )
#define PS_SOLID 0
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
#define BLUE RGB( 0x0 ,0x0 ,0x85 )
#define GREEN RGB( 0x0 ,0x85,0x0 )
#define CYAN RGB( 0x0 ,0x85,0x85 )
#define RED RGB( 0x85,0x0 ,0x0 )
#define MAGENTA RGB( 0x85,0x0 ,0x85 )
#define BROWN RGB( 0x85,0x85,0x0 )
#define WHITE RGB( 0xC6,0xC6,0xC6 )
#define CINZA RGB( 0x88 ,0x88 ,0x88 )
*
*--------------------------------------------------------------------------------------
FUNCTION Main()
LOCAL nPrn:=1
LOCAL aPrn:= GetPrinters()
REQUEST HB_CODEPAGE_PT850
HB_SetCodePage( "PT850" )
CLS
IF EMPTY(aPrn)
Alert("No printers installed - Cannot continue")
QUIT
ENDIF
DO WHILE !EMPTY(nPrn)
CLS
@ 0,0 SAY 'Programa de teste Classe WIN32PRN(). Escolha uma impressora. ESC' +;
' para sair.'
@ 1,0 TO maxRow(),maxCol()
nPrn:= ACHOICE(2,1,maxRow()-1,maxCol()-1,aPrn,.T.,,nPrn)
IF !EMPTY(nPrn)
PrnTest(aPrn[nPrn])
ENDIF
ENDDO
*
@ 22,00 say ""
RETURN(NIL)
*
*--------------------------------------------------------------------------------------
STATIC FUNCTION PrnTest(cPrinter)
LOCAL oPrinter:= WIN32PRN():New(cPrinter), aFonts, x, nColFixed, nColTTF, ;
nColCharSet, aForms
oPrinter:Landscape:= .F.
oPrinter:FormType := FORM_A4
oPrinter:Copies := 1
oprinter:SetPrintQuality(-1) // qualidade da impressão
IF !oPrinter:Create()
Alert("Cannot Create Printer")
ELSE
IF !oPrinter:startDoc( )
Alert("StartDoc() failed")
ELSE
oprinter:LineHeight := int(oprinter:PixelsPerInchy/8)
oPrinter:NewPage()
oPrinter:NewLine()
oPrinter:NewLine()
oPrinter:SetFont('Courier New',12,{1,12}, 0, .F., .F.)
oPrinter:Box( 100, 100, 2350, 300 )
oPrinter:Box( 2350, 100, 4700, 300 )
oPrinter:FillRect(110, 110, 2340, 290, CINZA)
oPrinter:FillRect(2350, 100, 4650, 290, CINZA)
oPrinter:SetPrc( 03 , 10 )
oPrinter:SetFont('ARIAL',9,{1,12}, 700, .F., .F.)
oPrinter:TextOut(" LINHA 03 COL 10 " ,.T.)
oPrinter:SetPrc( 03 , 50 )
oPrinter:TextOut(" LINHA 03 COL 50 " ,.T.)
oPrinter:EndDoc()
ENDIF
oPrinter:Destroy()
ENDIF
RETURN(NIL)
*
*------------------------------------------------------------------------------
Obrigado
Lócio


