Images
Klaus Major
klaus at major-k.de
Fri Jan 27 05:48:28 EST 2006
Hi Scott,
> Hi Scott,
>
>> Hi,
>>
>> I'm needing to load an image into a
>> card and then save that with the card
>> (the actual image and not the file
>> name reference to it). I tried the
>> code below. It almost works, but I get
>> a black and white image when the last
>> line is run in the procedure.
>>
>>
>> ---------- Paste -----------
>> answer file "Select the image:"
> ##set the filename of image "myImage" to it
> put url("binfile:" & it) into img "myimage"
> ## So the image is not referenced but imported!
>
>> set the left of image "myImage" to the left of me
>> set the top of image "myImage" to the top of me
>> set the rect of image "myImage" to the rect of me
>> set the imageData of image "myImage" to the Imagedata of image
>> "HerpImage"
Should be:
>> set the imageData of image "HerpImage" to the Imagedata of image
>> "myImage"
But may not be necessary, see below...
>
> ## this action will OVERWRITE the just imported image "myimage"
> ## with the image "HerpImage"!
> ## Just in case that is not intended :-)
> ## Or is this just a typo?
NOW i get it (i hope)! :-)
Looks like you only want to do this:
..
answer file "Select the image:"
put url("binfile:" & it) into img "HerpImage"
## set the correct width and height of img "HerpImage"
## and you are done :-)
...
Best
Klaus Major
klaus at major-k.de
http://www.major-k.de
More information about the use-livecode
mailing list