Does resizing an image change number of bytes?

Chipp Walters chipp at chipp.com
Wed Sep 28 00:55:20 EDT 2005


Steve,

Here's a handy function to 'flatten' a resized imgage:

on mouseUp
   put the id of img 1 into tImgID
   flattenImage tImgID
end mouseUp

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
end flattenImage

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.

best,

Chipp

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:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 




More information about the use-livecode mailing list