Mike,
Here are the methods to resize images, look in freeimcl.inc iImage Interface and you'll find them.
Some methods return the new image in the object, and the ones that have an (iImage dstImage) return the new image in another object via the passed iImage interface.
The source code example program has the most comprehensive use of the methods. Also the rescaling and rotation dialog objects show quite a bit too.
Rescale Procedure(*Real fPercentX, *Real fPercentY, UNSIGNED fiFilter),BOOL,Proc
Rescale Procedure(*Real fPercent, UNSIGNED fiFilter),BOOL,Proc
Rescale Procedure(UNSIGNED nDstWidth, UNSIGNED nDstHeight, UNSIGNED fiFilter),BOOL,Proc
Rescale Procedure(*iImage dstImage, Real fPercent, UNSIGNED fiFilter),BOOL,Proc !New Image is returned in dstImage
Rescale Procedure(*iImage dstImage, UNSIGNED nDstWidth, UNSIGNED nDstHeight, UNSIGNED fiFilter),BOOL,Proc !New Image is returned in dstImage
FitTo Procedure(UNSIGNED nDstWidth, UNSIGNED nDstHeight, UNSIGNED fiFilter=FILTER_BILINEAR, UNSIGNED FitMethod=CFIFIT_BOTH, UNSIGNED limitLongSideTo=0, BOOL maintainAspectRatio=True, BOOL adjustPower2=False),BOOL,Proc
Thumbnail Procedure(*iImage dstImage, UNSIGNED nDstWidth, UNSIGNED fiFilter),BOOL,Proc !New Image is returned in dstImage
Thumbnail Procedure(UNSIGNED nDstWidth, UNSIGNED fiFilter),BOOL,Proc
Thumbnail Procedure(*iImage dstImage, UNSIGNED nMaxPixelSize),BOOL,Proc !New Image is returned in dstImage
Thumbnail Procedure(UNSIGNED nMaxPixelSize),BOOL,Proc
So you'll need a FreeImage object:
fi FreeImageClass
Code
!Load some image into the object
if fi.iImage.Load('someImage.jpg')
!make a 128 px wide image maintaining aspect ratio
fi.iImage.Thumbnail(128, FILTER_BILINEAR) !See freeImg.inc and the freeimage docs on source forge for rescaling filters, there's an appendix that describes them
fi.iImage.SaveAs('someThumbnail.jpg')
end
There are a lot of options, what do you want to do?
Larry Sand