Does resizing an image change number of bytes?
chipp at chipp.com
Tue Sep 27 23:55:20 CDT 2005
Here's a handy function to 'flatten' a resized imgage:
put the id of img 1 into tImgID
on flattenImage pImgID
get the rect of img ID pImgID
set the rect of img ID pImgID to 0,0,10,10
set the resizeQuality of img ID pImgID to best
set the rect of img ID pImgID to it
put the alphadata of img ID pImgID into tAD
put the imagedata of img ID pImgID into tID
set the alphadata of img ID pImgID to tAD
set the imagedata of img ID pImgID to tID
Setting the resizeQuality to 'best' uses bilinear interpolation for the
resize, much better than the standard nearest neighbor interpolation.
Once you set it to best, you need to resize it for it to take effect,
thus the changing of the rect of the img.
Also, this will work with transparent png's as well.
Stgoldberg at aol.com wrote:
> Hope someone can help with this question. If I import an image, say 1 meg,
> into Revolution using "Import as Control" and then resize it to make it
> smaller, does it still take up 1 meg, or does it take up less memory? Thanks.
> Steve Goldberg
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode