Jump to content
Fivewin Brasil

problema em exibir imagem bmp


PJINFO

Recommended Posts

8 minutos atrás, PJINFO disse:

Olá Kapi!
Obrigado pela resposta. 
Eu uso a QRCodelib.Dll
Conforme o link.

Quando eu gero o QRcode.bmp e visualizando usando o windows está perfeito a exibição.
Quando mando imprimir o QRcode.bmp com tprint() vai normal, mas quando exib com a timage() não  aparece, fica em branco a imagem.  
Percebi que quando o conteudo do QRcode tem mais que 130/140 caractere fica normal mais que isso acontece isso.

Link to comment
Share on other sites

Ola. Testa estas funções aqui

#define LEVEL_L 0 // 7%
#define LEVEL_M 1 // 15%
#define LEVEL_Q 2 // 25%
#define LEVEL_H 3 // 30%

#define ENC_ALPHA 0 // encodes alphanumeric characters (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ); )
#define ENC_BYTE 1    // encodes binary values ( 8-bit data)
#define ENC_NUMERIC 2 // encodes numeric values only (digits 0-9)
#define ENC_KANJI 3   // encodes Kanji characters. Kanji characters in QR Code can have values 8140 -9FFC and E040 - EBBF
#define ENC_AUTO 4    // automatic seleccion of the encoding algorithm

///////////////////////////////////////////////////////////////////////////////
FUNCTION QR_CODE_FULL_PNG(f_cString, f_cFileRoot, f_nSizePixel, f_nLevel)
   Local lc_cFileOut := "", lc_oImage
   
   Default f_nSizePixel := 180, f_nLevel := 0
   
   if File(f_cFileRoot)
      fErase(f_cFileRoot)
   EndIf

   lc_cFileOut := TXT_CHAR_CLEAN(f_cFileRoot,{".bmp",".BMP","Bmp"})+".png"

   FullQRCodeMy(.T.,;
                   .f.,;
                   CLR_WHITE,;  // backColor
                   CLR_BLACK,;        // barColor
                   f_cString,; // Texto
                   f_nLevel,;   // correctionLevel
                   ENC_AUTO,;  // encoding
                   2,;   // marginpixels
                   2,;   // moduleWidth
                   f_nSizePixel ,; // Height
                   f_nSizePixel ,; // Witdh
                   f_cFileRoot) 

   lc_oImage := tImage():Define(,f_cFileRoot) 
   lc_oImage:SaveImage( lc_cFileOut, 13,0 )
   lc_oImage:End()

   fErase(f_cFileRoot)

RETURN lc_cFileOut
///////////////////////////////////////////////////////////////////////////////
DLL32 Function FullQRCodeMy(autoConfigurate AS BOOL,;
                              AutoFit AS BOOL ,;
                              backColor AS _INT ,;
                              barColor AS _INT ,;
                              Texto AS LPSTR ,;
                              correctionLevel AS _INT,; // Pode ser Low, Medium, High e VeryHigh
                              encoding AS _INT, ;
                              marginpixels AS _INT,;
                              moduleWidth AS _INT,;
                              Height AS _INT,;
                              Width AS _INT,;
                              FileName AS LPSTR ) AS LONG PASCAL FROM "FullQRCode" LIB "QRCodelib.dll"

///////////////////////////////////////////////////////////////////////////////
FUNCTION TXT_CHAR_CLEAN(f_cTxt,f_aCaracteresRetira)
	Local cTxtRetorno := f_cTxt, iFor := 0
	
	For iFor := 1 To Len(f_aCaracteresRetira)
		 cTxtRetorno := StrTran(cTxtRetorno,f_aCaracteresRetira[iFor],"")
	Next
	 
RETURN cTxtRetorno

 

Link to comment
Share on other sites

2 horas atrás, giovanyvecchi disse:

Ola. Testa estas funções aqui


#define LEVEL_L 0 // 7%
#define LEVEL_M 1 // 15%
#define LEVEL_Q 2 // 25%
#define LEVEL_H 3 // 30%

#define ENC_ALPHA 0 // encodes alphanumeric characters (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ); )
#define ENC_BYTE 1    // encodes binary values ( 8-bit data)
#define ENC_NUMERIC 2 // encodes numeric values only (digits 0-9)
#define ENC_KANJI 3   // encodes Kanji characters. Kanji characters in QR Code can have values 8140 -9FFC and E040 - EBBF
#define ENC_AUTO 4    // automatic seleccion of the encoding algorithm

///////////////////////////////////////////////////////////////////////////////
FUNCTION QR_CODE_FULL_PNG(f_cString, f_cFileRoot, f_nSizePixel, f_nLevel)
   Local lc_cFileOut := "", lc_oImage
   
   Default f_nSizePixel := 180, f_nLevel := 0
   
   if File(f_cFileRoot)
      fErase(f_cFileRoot)
   EndIf

   lc_cFileOut := TXT_CHAR_CLEAN(f_cFileRoot,{".bmp",".BMP","Bmp"})+".png"

   FullQRCodeMy(.T.,;
                   .f.,;
                   CLR_WHITE,;  // backColor
                   CLR_BLACK,;        // barColor
                   f_cString,; // Texto
                   f_nLevel,;   // correctionLevel
                   ENC_AUTO,;  // encoding
                   2,;   // marginpixels
                   2,;   // moduleWidth
                   f_nSizePixel ,; // Height
                   f_nSizePixel ,; // Witdh
                   f_cFileRoot) 

   lc_oImage := tImage():Define(,f_cFileRoot) 
   lc_oImage:SaveImage( lc_cFileOut, 13,0 )
   lc_oImage:End()

   fErase(f_cFileRoot)

RETURN lc_cFileOut
///////////////////////////////////////////////////////////////////////////////
DLL32 Function FullQRCodeMy(autoConfigurate AS BOOL,;
                              AutoFit AS BOOL ,;
                              backColor AS _INT ,;
                              barColor AS _INT ,;
                              Texto AS LPSTR ,;
                              correctionLevel AS _INT,; // Pode ser Low, Medium, High e VeryHigh
                              encoding AS _INT, ;
                              marginpixels AS _INT,;
                              moduleWidth AS _INT,;
                              Height AS _INT,;
                              Width AS _INT,;
                              FileName AS LPSTR ) AS LONG PASCAL FROM "FullQRCode" LIB "QRCodelib.dll"

///////////////////////////////////////////////////////////////////////////////
FUNCTION TXT_CHAR_CLEAN(f_cTxt,f_aCaracteresRetira)
	Local cTxtRetorno := f_cTxt, iFor := 0
	
	For iFor := 1 To Len(f_aCaracteresRetira)
		 cTxtRetorno := StrTran(cTxtRetorno,f_aCaracteresRetira[iFor],"")
	Next
	 
RETURN cTxtRetorno

 

Opa!!!
Obrigado!!! Vou testar sim.
Já já dou notícias.

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...