ImageData restore problems

J. Landman Gay jacque at hyperactivesw.com
Sun Sep 21 15:28:29 EDT 2014


On 9/20/2014, 2:02 PM, FlexibleLearning.com wrote:
> I have an embedded image, size 120Kb, and want to toggle between a
> non-compacted (120Kb) and a compacted (30Kb) thumbnail version...
>
> 1. I thumbnail the original image (data is still 120Kb as expected).
> 2. I store the TEXT of the resized image.
> 3. I compact the image by setting the imageData of the image to the
> imagedata of the image. The size reduces to 30Kb as expected.
> 4. I restore the saved binary data.
> Result: A blank image
>
> 1. I thumbnail the original image (data is still 120Kb as expected).
> 2. I store the IMAGEDATA of the resized image.
> 3. I compact the image by setting the imageData of the image to the
> imagedata of the image. The size reduces to 30Kb as expected.
> 4. I restore the saved ImageData.
> Result: 30kb, not 120Kb
>
> Question:
> What must I store in Step 2 above in order to re-instate the 120Kb data in
> the thumbnail?

set the cImg of this cd to the text of img 1 -- store it
-- now resize the image as a thumbnail here
set the imagedata of img 1 to the imagedata of img 1 -- reduce the 
size/compress it
set the text of img 1 to the cImg of this cd -- restore original
-- optional:
set the width of img 1 to the formattedwidth of img 1
set the height of img 1 to the formattedheight of img 1


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list