Impressao Imagem Bmp

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Sergio_ASSilva
Usuário Nível 2
Usuário Nível 2
Mensagens: 92
Registrado em: 09 Mar 2006 10:58
Localização: Santo Estevão (Ba)

Impressao Imagem Bmp

Mensagem por Sergio_ASSilva »

Bom dia a Todos,

Pessoal consegui imprimir a logomarca da empresa no relatorio, acontece que gostaria que ficasse centralizado porem nao estou conseguindo, tem como colocar a logomarca no centro do relatorio ?

Segue codigo para analise:

FUNCTION Main()
LOCAL aPrn:= GetDefaultPrinter()
LOCAL oPrinter:= Win32Prn():New(aPrn), oBmp
CLS
IF EMPTY(aPrn)
Alert("No printers installed - Cannot continue")
QUIT
ENDIF

IF !oPrinter:Create()
Alert("Cannot Create Printer")
ELSE
IF !oPrinter:startDoc('Win32Prn - Print BMP')
Alert("StartDoc() failed")
ELSE
oBmp:= Win32BMP():new()
IF oBmp:loadFile("LOGO.BMP")
oBmp:Draw( oPrinter, { 100,100, 1000, 750 } )
ENDIF
oBMP:Destroy()
oPrinter:EndDoc()
ENDIF
oPrinter:Destroy()
ENDIF
RETURN(NIL)


Sds.


Sérgio
Clipper 5.3a/Blinker 7/DBFNTX
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7131
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Contato:

Mensagem por sygecom »

Olha o que diz o Help...por ai vc pode ter uma noção !!!

****************
oWin32Bmp:draw()
Draws the bitmap image to a printer.
Syntax
:draw( <oWin32Prn>, <aRectangle> ) --> lSuccess
Arguments
<oWin32Prn>
This parameter must be a Win32Prn() object.
<aRectangle> := { <nX1>, <nY1>, <nX2>, <nY2> }
This is a one dimensional array of four elements. It holds numeric values specifying the X/Y coordinates of the upper-left (<nX1>, <nY1>) and lower-right (<nX2>, <nY2>) position on the printer wher the bitmap image is drawn. The coordinates must be specified in pixel units. Description
Method :draw() sends a loaded bitmap image to the printer specified with <oWin32Prn>. The coordinates passsed with <aRectangle> are printer coordinates. i.e. they tell the Win32Prn object, where to print the bitmap on paper.
If the rectangle <aRectangle> does not match the size of the bitmap image, the image is automatically scaled and/or transformed to the size of <aRectangle>.
****************
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
Sergio_ASSilva
Usuário Nível 2
Usuário Nível 2
Mensagens: 92
Registrado em: 09 Mar 2006 10:58
Localização: Santo Estevão (Ba)

Mensagem por Sergio_ASSilva »

Entedi.....

Obrigado companheiro.
Clipper 5.3a/Blinker 7/DBFNTX
Avatar do usuário
Sergio_ASSilva
Usuário Nível 2
Usuário Nível 2
Mensagens: 92
Registrado em: 09 Mar 2006 10:58
Localização: Santo Estevão (Ba)

Mensagem por Sergio_ASSilva »

Sygecom, onde encontro o Help XHarbour ?



Grato

Sérgio
Clipper 5.3a/Blinker 7/DBFNTX
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7131
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Contato:

Mensagem por sygecom »

Baixe no site do xharbour comercial:
http://www.xharbour.com/xhdn/referenceguide/
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
Luciano Bonfim
Usuário Nível 3
Usuário Nível 3
Mensagens: 414
Registrado em: 23 Ago 2007 09:34
Localização: Rio de Janeiro / São Paulo
Contato:

Mensagem por Luciano Bonfim »

Tem como baixar o guia de referëncia? pensei que só pudesse consultar on-line.

Como Baixo?
Muito Obrigado,

Luciano Bonfim de Azevedo
www.bonfim.com.br
luciano@bonfim.com.br
www.linkedin.com/in/lucianobonfim
Skype : lucianobonfim
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7131
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Contato:

Mensagem por sygecom »

No link que postei acima vc tem que selecionar um dos dois tipos que queres baixar o Help em PDF format (demo) ou CHM format (demo) de baixar.

Abraços
Leonardo Machado
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
juniorcamilo
Usuário Nível 3
Usuário Nível 3
Mensagens: 343
Registrado em: 10 Nov 2006 09:12
Localização: Pará

Impressao Imagem Bmp

Mensagem por juniorcamilo »

sygecom escreveu:Olha o que diz o Help...por ai vc pode ter uma noção !!!



****************

oWin32Bmp:draw()

Draws the bitmap image to a printer.

Syntax

:draw( <oWin32Prn>, <aRectangle> ) --> lSuccess

Arguments

<oWin32Prn>

This parameter must be a Win32Prn() object.

<aRectangle> := { <nX1>, <nY1>, <nX2>, <nY2> }

This is a one dimensional array of four elements. It holds numeric values specifying the X/Y coordinates of the upper-left (<nX1>, <nY1>) and lower-right (<nX2>, <nY2>) position on the printer wher the bitmap image is drawn. The coordinates must be specified in pixel units. Description

Method :draw() sends a loaded bitmap image to the printer specified with <oWin32Prn>. The coordinates passsed with <aRectangle> are printer coordinates. i.e. they tell the Win32Prn object, where to print the bitmap on paper.

If the rectangle <aRectangle> does not match the size of the bitmap image, the image is automatically scaled and/or transformed to the size of <aRectangle>.

****************
Boa tarde!
estou imprimindo a logo na mini impressora elgin i9, mas, apos imprimir essa log pula algumas linhas! como faço para nao pular essas linhas?

Código: Selecionar todos

************************************************************************************************
FUNCTION ImprimeLogo(cFileName,cImpressora, aParametro)

LOCAL o| oWin32Prn,  aParametro )
*            oWin32Bmp:draw( oWin32Prn,  { 45, 10, 900, 759 } )
            *nTamlogo := 9
            *FOR i=1 to nTamLogo
            *    oWin32Prn:newline()
            *NEXT
            *oWin32Prn:setfont('Courier New',,12,,,,255)
            *
            *oWin32Prn:TextOut("1Empresa.: XPTO LTDA", .T.)
            *oWin32Prn:TextOut("2Empresa.: XPTO LTDA", .T.)
            *oWin32Prn:TextOut("3Empresa.: XPTO LTDA", .T.)
            *oWin32Prn:TextOut("4Empresa.: XPTO LTDA", .T.)
            *oWin32Prn:TextOut("5Empresa.: XPTO LTDA", .T.)
            *oWin32Prn:TextOut("CNPJ....: 99.999.999/0001-99", .T.)
            *oWin32Prn:TextOut("Situacao: INATIVA", .T.)
            oWin32Prn:EndDoc()
            oWin32Prn:destroy()
         endif
      endif
   endif
else
   bImpLogo := .f.
endif
CATCH e
   @ 23,00 SAY PADC("Erro ao imprimir logo!!",80)
   inkey(1)
   RETURN .F.
END
RETURN bImpLogo
**********************
Avatar do usuário
juniorcamilo
Usuário Nível 3
Usuário Nível 3
Mensagens: 343
Registrado em: 10 Nov 2006 09:12
Localização: Pará

Impressao Imagem Bmp

Mensagem por juniorcamilo »

descobri! na propriedade da impressora tem q estar ModoCorte: Nenhum, Impressão do Logo: "Não imprime o NV Logo! eu havia mexido nisso!
Responder