Jump to content
Fivewin Brasil

oribeiro

Membros
  • Posts

    1,291
  • Joined

  • Last visited

  • Days Won

    35

oribeiro last won the day on February 1 2022

oribeiro had the most liked content!

1 Follower

About oribeiro

  • Birthday 02/19/1965

Contact Methods

  • Website URL
    www.oasysitu.com

Profile Information

  • Gender
    Male
  • Location
    Itu, SP

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

oribeiro's Achievements

Newbie

Newbie (1/14)

79

Reputation

Single Status Update

See all updates by oribeiro

  1. Ola Ribeiro. Vi alguns comentarios de voce la no forum, tentanto gerar um codigo QR.

    Tentei de todas as formas. Voce pode me dar alguma dica ?

    Obrigado

     

    1. Show previous comments  3 more
    2. oribeiro

      oribeiro

      Só consegui gerando um bitmap mesmo. Não sei fazer de outro modo.

      Mas essa rotina gera um BITMAP, importa-o para a memória e o apaga no disco, daí, com ele na memória é possível imprimir ou mostrar na tela como faz esse exemplo.

    3. xtsystem

      xtsystem

      OK Ribeiro. Agradeço muito a sua ajuda e vou procurar saber se tem como gerar o codigo somente na memória e imprimir. q

    4. oribeiro

      oribeiro

      Achei esse código, veja se funciona: ( Ele depende da Biblioteca gratuita da ZEBRA ). Você pode encontrá-la na internet.

         // CODIGO QRCODE//
         local cCode   := "20219719443 | 01 | F001 | 00045256 | 25/01/2018 | 18.00 | 118.00 | 6 | 10087302682 |" +CHR(13)+CHR(10)+ "Gerado no OASySItu.Com"
         local nWidth  := 0
         local nHeight := 0
         local nX      := 18
         local nY      := 18
         local oX      := 11
         local oY      := 11
         local hBrush
         local hZebra
         local oFontText
         local oPrn
         local oBmp, hBmp, hBrush1, hBrush2, hGraf
      
         // CRIA QRCODE  //
         hBrush    := CreateSolidBrush( 0 )
         hZebra    := hb_Zebra_Create_Qrcode( cCode, NIL )
      
         // PRINT QRCODE //
         DEFINE FONT oFontText NAME "Calibri" SIZE 0, -11
         PRINT oPrn NAME "Imprimir QrCode" PREVIEW
         PAGE
            // imprime o QRCode //
            hb_zebra_draw( hZebra, { | x, y, w, h | nWidth := x + w, nHeight := y + h, FillRect( oPrn:hDCOut, { y, x, y + h, x + w }, hBrush ) }, nX, nY, oX, oY )
            // imprime o Texto  //
            oFontText:Activate( oPrn:hDCOut )
            DrawText( oPrn:hDCOut, cCode, { nHeight + 10, nX - 4, nHeight + 24, nWidth + 4 }, 0 )
            oFontText:DeActivate( oPrn:hDCOut )
         ENDPAGE
         ENDPRINT
         oFontText:End()
      
         // SAVE BMP-PNG //
         hBrush1   := GdiPlusNewSolidBrush( 255, 255, 255, 255 )
         hBrush2   := GdiPlusNewSolidBrush( 255,   0,   0,   0 )
         oBmp      := GdiBmp():New()
         hBmp      := GdiPlusBmpFromBrush( nWidth + nX, nHeight + nY, hBrush1 )
         hGraf     := GdiPlusHGraFFromHBmp( hBmp )
         hb_zebra_draw( hZebra, { | x, y, w, h | GdiPlusDrawRect( hGraf, , hBrush2, x, y, w, h ) }, nX, nY, oX - 0.5, oY - 0.5 )
         oBmp:hBmp := hBmp
         GdiPlusDeleteGraphics( hGraf )
         GdiPlusDeleteBrush( hBrush2  )
         GdiPlusDeleteBrush( hBrush1  )
         oBmp:Save( "QRCODE.PNG" )
         oBmp:End()

       

×
×
  • Create New...