Setting image quality programmatically

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jason.lubken
Posts: 4
Joined: Wed Jun 06, 2007 6:35 pm

Setting image quality programmatically

Post by jason.lubken » Sat Oct 06, 2007 7:38 pm

There is an image property named "Quality" which allows one to select "Normal", "Good" or "Best" via a combobox. Is there a way to access this property programmatically? It doesn't appear to be included in the properties array of the image.

Thanks

Lynn P.
Posts: 79
Joined: Sun Apr 09, 2006 1:09 pm

Re: Setting image quality programmatically

Post by Lynn P. » Sat Oct 06, 2007 8:59 pm

jason.lubken wrote:There is an image property named "Quality" which allows one to select "Normal", "Good" or "Best" via a combobox. Is there a way to access this property programmatically? It doesn't appear to be included in the properties array of the image.

Thanks
This is one of my major pet peeves with Rev... it's lack of thorough documentation in a logical presentation. :x

Try this:

Code: Select all

--to get this property of an image
put the resizeQuality of img "myImage" into msg -- or a variable or custom propery
--to set this property for an image
set the resizeQuality of img "myImage" to Good --or Normal or Best
I believe someone may have said this property only works in Windows, but I'm not sure on that. This snippet was from the Engine Change Log file when 2.8 first arrived I believe. Sivakatirswami posted this over on the Rev list. He noted the text was truncated so even the Engine Change Log wasn't complete on this new feature.
`````````````````````````````
Improved Image Resizing
~~~~~~~~~~~~~~~~~~~~~~~
   There are now three levels of image resize quality:
     - normal: uses a 'nearest' filter - i.e. no interpolation
     - good: uses a 'bilinear' filter - i.e. interpolation is done
between the four nearest pixels using bilinearity
     - best: uses a 'bicubic' filter - i.e. interpolation is done using
cubic approximation from near pixels
   The filter used can be set using the 'resizeQuality' property of
images. 'normal' is the fastest scaling method, followed by 'good' and
then 'best'.

   N.B. The image quality is now a persistent property of images.

   N.B. Due to the current engine graphics architecture, the quality
[missing text here]
```````````````````````````
If you're looking for image quality, check out JPEGQuality which is in the documentation.

jason.lubken
Posts: 4
Joined: Wed Jun 06, 2007 6:35 pm

Post by jason.lubken » Sat Oct 06, 2007 9:36 pm

Thanks so much Lynn. Things look terrible with 'Normal', but scaling is too slow in some cases with 'Best'. I couldn't agree more with the documentation issues. I don't know why this property isn't part of the properties array either...

Thanks again!

Post Reply