Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ImgSource.dll by Smaller Animals
Message
From
21/07/2000 18:31:58
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
ImgSource.dll by Smaller Animals
Miscellaneous
Thread ID:
00395756
Message ID:
00395756
Views:
47
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]
:>
Reply
Map
View

Click here to load this message in the networking platform