Legal José, obrigado por compartilhar...
[]´s
"José Alves Siqueira" wrote in message news:52aa16a6$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Olá
Se precisar gravar imagem em .DBF pode usar a rotina abaixo. No exemplo
estou gravando um .EXE mas pode gravar qualquer imagem.
** inicio rotina
* ArqImage.DBF COM 6 campos memos
* aqui estou salvando um executavel com o nome de gernota_fe.exe mas pode-se
salvar imagens que tambem dara certo
FUNCTION main
arquivo="c:s_gernota_fegernota_fe.exe"
caso=3
if caso=1 .OR. caso=3
** SALVA ARQUIVO EM DBF
qdirectory:=directory(arquivo)
mretorno=BinData(Memoread( arquivo ),.T.)
mtamimagem:=LEN(mretorno)
mtamgravar:=mtamimagem
mdividegrv:=INT(LEN(mretorno)/659000)
IF mdividegrv>1
mtamgravar:=INT(LEN(mretorno)/mdividegrv)
ENDIF
IF !FILE("ARQIMAGE.DBF")
estru:={{"MEMO01","M",8,0},{"MEMO02","M",8,0},{"MEMO03 ","M",8,0},{"MEMO04","M",8,0},{"MEMO05","M",8,0},{ "MEMO06","M",8,0},{"QTGRAVMEMO","N",2,0}}
DBCREATE("ARQIMAGE.DBF",estru)
ENDIF
mcontadgrv:=1
USE
USE ARQIMAGE ALIAS ARQIMAGE
IF LASTREC()=0
APPEND BLANK
ENDIF
DO WHILE !EMPTY(mretorno)
mretorgrv:=substr(mretorno,1,mtamgravar)
ARQIMAGE->&("MEMO"+STRZERO(mcontadgrv,2)):=mretorgrv
* x:=ARQIMAGE->&("MEMO"+STRZERO(mcontadgrv,2))
mretorno:=substr(mretorno,mtamgravar+1)
mcontadgrv++
ENDDO
ARQIMAGE->QTGRAVMEMO:=mcontadgrv-1
* FIM SALVA ARQUIVO EM DBF
ENDIF
*
************************************************************ ************************************
IF caso=2 .OR. caso=3
IF caso=2
USE
USE ARQIMAGE ALIAS ARQIMAGE
ENDIF
* VOLTANDO IMAGEM DO ARQUIVO
mcontadgrv:=1
mretorno:=""
DO WHILE mcontadgrv<=ARQIMAGE->QTGRAVMEMO
mretorgrv:=ARQIMAGE->&("MEMO"+STRZERO(mcontadgrv,2))
mretorno+=mretorgrv
*? LEN(mretorgrv)
* ARQIMAGE->&("MEMO"+STRZERO(mcontadgrv,2)):=mretorgrv
* x:=ARQIMAGE->&("MEMO"+STRZERO(mcontadgrv,2))
* mretorno:=substr(mretorno,mtamgravar+1)
mcontadgrv++
ENDDO
mretorno:=BinData(mretorno,.F.)
caminearq=FCREATE("c:s_gernota_fetemp.EXE",0)
* Gravacao no arquivo.
FWRITE(caminearq,mretorno, Len(mretorno))
FCLOSE(caminearq)
* FIM VOLTANDO IMAGEM DO ARQUIVO
ENDIF
RETURN.T.
* #INCLUDE "common.ch"
function BinData(x,maskOnOff)
IF maskOnOff
x := StrTran(x,chr(00),'Ch#00Er')
x := StrTran(x,chr(26),'Ch#26Er')
x := StrTran(x,chr(34),'Ch#34Er')
x := StrTran(x,chr(39),'Ch#39Er')
x := StrTran(x,chr(47),'Ch#47Er')
x := StrTran(x,chr(91),'Ch#91Er')
x := StrTran(x,chr(92),'Ch#92Er')
x := StrTran(x,chr(93),'Ch#93Er')
x := StrTran(x,chr(96),'Ch#96Er')
x := StrTran(x,chr(132),'Ch#132Er')
x := StrTran(x,chr(145),'Ch#145Er')
x := StrTran(x,chr(146),'Ch#146Er')
x := StrTran(x,chr(148),'Ch#148Er')
x := StrTran(x,chr(180),'Ch#180Er')
ELSE
x := StrTran(x,'Ch#00Er',chr(00))
x := StrTran(x,'Ch#26Er',chr(26))
x := StrTran(x,'Ch#34Er',chr(34))
x := StrTran(x,'Ch#39Er',chr(39))
x := StrTran(x,'Ch#47Er',chr(47))
x := StrTran(x,'Ch#91Er',chr(91))
x := StrTran(x,'Ch#92Er',chr(92))
x := StrTran(x,'Ch#93Er',chr(93))
x := StrTran(x,'Ch#96Er',chr(96))
x := StrTran(x,'Ch#132Er',chr(132))
x := StrTran(x,'Ch#145Er',chr(145))
x := StrTran(x,'Ch#146Er',chr(146))
x := StrTran(x,'Ch#148Er',chr(148))
x := StrTran(x,'Ch#180Er',chr(180))
ENDIF
return x
** fim rotina
Sem mais
José Alves Siqueira
"Xevi" escreveu na notícia da mensagem:52a96b32$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Mario,
Yo lo que hago es guardar una ruta de la imagen en cuestión, y así, cada vez
que necesito de ella, la busco en la ruta y la abro, o la copio...
Un Saludo,
Xevi.
"Mario Hormigo" <mhormigoz[at]hotmail[dot]com> ha escrit al
missatge:52a8fb84$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Buenas a todos:
>
> ¿Se puede?, leyendo y leyendo, usando el tipo general,
> por lo visto si se puede, pero no se como hacerlo. Si alguien sabe algo,
> se lo agradeceria.
> Lo necesito, para pasarle imáges al Crystal Reports 8.
>
> Gracias de antemano.
> Mario Hormigo.
---
Este email está limpo de vírus e malwares porque a proteção do avast! Antivírus está ativa.
http://www.avast.com