Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ImgSource.dll by Smaller Animals
Message
De
21/07/2000 18:31:58
Steve Summers
Pima County Superior Court
Tucson, Arizona, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
ImgSource.dll by Smaller Animals
Divers
Thread ID:
00395756
Message ID:
00395756
Vues:
48
I'm looking for help on using this _Isource.dll api. I have an C++ version and need to convert it to work in VFP.

here is the C++ code:

HISSRC hSrc; // source manager
HISDEST hDest; // output manager
UINT32 inWidth, inHeight; // dims
HGLOBAL hImg, hImgCrop; // a couple of memory handles

*-- open
hSrc = ISOpenFileSource(pFilename);

*-- read
hImg = ISReadJPGToRGB(hSrc, &inWidth, &inHeight);

*-- check for error
res = ISGetLastError() && // res had better be IS_ERR_OK (0)

*-- close
ISCloseSource(hSrc)

*-- now, hImg is a pointer to the image RGB pixels and "inWidth" and "inHeight" are the dimensions

*-- allocate room for the cropped image - an RGB pixel is 3 BYTEs
hImageCrop = GlobalAlloc(GPTR, (outWidth * outHeight * 3))

*-- do the crop (actually, a partial copy)
ISCropRGB((BYTE *)hImg, inWidth, inHeight, (BYTE *)hImageCrop, outLeftX, outTopY, outRightX, outBottomY)

*-- check for error
res = ISGetLastError() && // res had better be IS_ERR_OK (0)

*-- done with the original
GlobalFree(hImg)

*-- open destination
hDest = ISOpenFileDest(pFilenameOut)

*-- write
ISWriteRGBToJPG(hDest, (BYTE *)hImageCrop, outWidth, outHeight, uQuality, 0)

*-- check for error
res = ISGetLastError() && res had better be IS_ERR_OK (0)

*-- close
ISCloseDest(hDest)

*-- clean up
GlobalFree(hImageCrop)

I'm not sure what defines I need. Any help would be appreciated.
Thanks in advance or I hope this helps!

[STS]
:>
Répondre
Fil
Voir

Click here to load this message in the networking platform