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]
:>