Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extact image from general field into file
Message
 
À
31/12/2001 10:18:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
00599253
Message ID:
00599510
Vues:
22
In fact I did not use any API functions. It is done by couple lines of simple code, that you can see below. This code I used to use in my App FRX2ANY.ZIP
in order to extract BMP image from Gen field into file. If you will find something that can be improved, let me know.
Best wishes

*****************************************************************************
LPARAMETERS tcGenFldName

LOCAL lnInHandle
LOCAL lnOutHandle
LOCAL lnFileLen

LOCAL lcTmpFile
LOCAL lcBmpFile
LOCAL lcString

LOCAL loResult
LOCAL lcOldComp

lcTmpFile = ADDBS(SYS(2023)) + SYS(2015)
lcBmpFile = ADDBS(THIS.cReportPath) + SYS(2015) + '.BMP'

COPY TO (lcTmpFile) FIELDS (tcGenFldName) NEXT 1

lnInHandle = FOPEN(lcTmpFile + '.FPT')
lnOutHandle = FCREATE(lcBmpFile)

IF lnInHandle >0 AND lnOutHandle > 0

lnFileLen = FSEEK(lnInHandle, 0, 2)
= FSEEK(lnInHandle, 0)

lcString = FREAD(lnInHandle, lnFileLen)
lcString = RIGHT(lcString, LEN(lcString) - 599)
=FWRITE(lnOutHandle, lcString)
ELSE
lcBmpFile = ''
ENDIF

=FCLOSE(lnInHandle)
=FCLOSE(lnOutHandle)

IF FILE(lcTmpFile + '.FPT')
DELETE FILE (lcTmpFile + '.*')
ENDIF

RETURN lcBmpFile
******************************************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform