NetTalk Central

Author Topic: Clarion FreeImage documentation?  (Read 27211 times)

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Clarion FreeImage documentation?
« on: August 02, 2013, 07:46:48 PM »
I have just switched over my NetTalk Web apps from ImageEx to Clarion FreeImage, just because it's a little cleaner. But I can't seem to find documentation to tell me what I can do with FreeImage for Clarion.

I used some code Bruce put up to create a thumbnail, but it doesn't really give me the control over producing an image of a specific size.

For example, I need to resize all images to 480 wide and have the height proportional, but I can't seem to get where to do that in the actual FreeImage docs, since they are not Clarion specific. Anyone know if there is actual Clarion template/code docs/help, or how to manage this specific example? Thanks!
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Clarion FreeImage documentation?
« Reply #1 on: August 03, 2013, 09:27:19 PM »
Hi Mike,

The project DLL itself is documented here;
http://freeimage.sourceforge.net/
specifically - http://downloads.sourceforge.net/freeimage/FreeImage3154.pdf

ClarionFreeimage is a wrapper around that, so using that, and the wrapper together, is probably the best way to determine what's available.

cheers
Bruce

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Clarion FreeImage documentation?
« Reply #2 on: August 04, 2013, 09:03:26 AM »
Thanks Bruce, I was trying to use more of the hand code stuff. The exact Clarion code is a bit hidden in template code, and the FreeImage docs are not very clear on "here's how to resize an image and specify its size." I'll just grind through it I guess.
Mike Grigsby
Credify Systems
Central Oregon, USA

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: Clarion FreeImage documentation?
« Reply #3 on: August 07, 2013, 12:47:10 PM »
The ImageEx ThumbNailClass is very nice and pretty simple to use.

Nick

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Clarion FreeImage documentation?
« Reply #4 on: August 08, 2013, 10:06:17 AM »
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

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Clarion FreeImage documentation?
« Reply #5 on: August 09, 2013, 07:42:41 AM »
Thanks so much Larry. That makes things a lot more clear.
Mike Grigsby
Credify Systems
Central Oregon, USA

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Clarion FreeImage documentation?
« Reply #6 on: August 14, 2013, 06:34:00 AM »
You're welcome Mike,

If you document what you find and send it to me I'll see about including it.

Larry Sand