Página 1 de 1

Impressao Imagem Bmp

Enviado: 25 Out 2007 10:47
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

Enviado: 25 Out 2007 18:55
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>.
****************

Enviado: 26 Out 2007 09:19
por Sergio_ASSilva
Entedi.....

Obrigado companheiro.

Enviado: 26 Out 2007 15:53
por Sergio_ASSilva
Sygecom, onde encontro o Help XHarbour ?



Grato

Sérgio

Enviado: 26 Out 2007 17:08
por sygecom
Baixe no site do xharbour comercial:
http://www.xharbour.com/xhdn/referenceguide/

Enviado: 29 Out 2007 14:04
por Luciano Bonfim
Tem como baixar o guia de referëncia? pensei que só pudesse consultar on-line.

Como Baixo?

Enviado: 29 Out 2007 14:11
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

Impressao Imagem Bmp

Enviado: 30 Jun 2020 14:59
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
**********************

Impressao Imagem Bmp

Enviado: 01 Jul 2020 09:10
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!