Reducing image data size
Björnke von Gierke
bvg at mac.com
Mon Feb 18 07:07:49 EST 2008
The simplest way to do this is with imageData. Something like the
following should do the trick (untested):
on mouseUp
put 100,100,180,180 into theRect --or whatever
set the rectangle of image 1 to theRect --original image
set the rectangle of image 2 to theRect --thumbnail image
set the imagedata of image 2 to the imagedata of image 1
set the height of image 1 to the formattedHeight of image 1
set the width of image 1 to the formattedWidth of image 1
end mouseUp
Note that the two images need to have the exact same rectangle, or the
second image will show distorted garbage, or nothing at all.
have fun
Bjoernke
PS: I used this in Malta during my presentation, but also transfered
the imagedata over a socket. So you could theoretically even save the
imagedata to a file, for later retrieval.
On 18 Feb 2008, at 11:55, FlexibleLearning at aol.com wrote:
> If import a big image and reduce its dimensions to a thumbnail, how
> do I
> reduce the data size of the thumbnail?
>
> If this has already been written up somewhere, could someone point
> it out to
> me? The imageData dox entry describes what it is but not really how
> to use
> it.
>
> (Hugh has shinpads on, ready for kicking self)
--
official ChatRev page:
http://chatrev.bjoernke.com
Chat with other RunRev developers:
go stack URL "http://homepage.mac.com/bvg/chatrev1.3.rev"
More information about the use-livecode
mailing list