LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
you can use a little script that I once wrote for this purpose, it will loop through all cards of your stack
and put the binary data of the referenced images into the images!
on mouseUp
set the defaultstack to "Name of your stack with referenced images here!"
lock screen
lock messages
## Loop through all cards of this stack:
repeat with i = 1 to the num of cds
set cursor to busy
## Loop through all images on card:
repeat with k = 1 to the num of images of cd i
put the filename of image k of cd i into tFileName
## No referenced image, so carry on...
if tFileName = empty then
next repeat
end if
## Put the binary data into the image (that is the same as "import as control"):
put url("binfile:" & tFileName) into image k of cd i
end repeat
end repeat
unlock screen
unlock messages
answer "Done!" & CR & "Don't forget to save stack" && QUOTE & "Name of your stack with referenced images here!" & QUOTE & "!"
end mouseUp
on mouseUp pMouseBtnNo
set the imagedata of image 1 to the imagedata of image 1
end mouseUp
this eliminates the reference and you can see in the inspector that the filename is empty.
I did not try Klaus's code but you can try this.
regards
Bernd
on mouseUp pMouseBtnNo
set the imagedata of image 1 to the imagedata of image 1
end mouseUp
is that in case you had resized your original image to a smaller size then this code will fix the smaller size, discarding the information of the larger image.
Just in case...
regards
Bernd
I've tried it again and it's doing the same thing.
New Mainstack.
One button with your script in it.
If I import single images (one after the other) as reference and click the button all the images vanish.
If I import as "New Referenced Control" -> "reference "All Images in Folder..." and click your button script the images stay put and get converted to control images.
You should copy the imageData as well as the alphaData of the image, and make sure the target has the same width and height as the source image. To avoid that, use the unfortunately named text property of the image.
does not seem to work for me. Just setting either the imagedata or the alphadata gets rid of the "filename" and the image is an "imported" image. Apart from setting the size of an image permanently to the displayed size I never had any problem with this.
Klaus's solution should work around this limitation.
regards
Bernd
could it have to do with absolute or relative file referencing? In the preferences is an option for images to always use absolute references. Under files and memory the last option.
Just a guess, I seem to remember that I had problems with this once, but dont remember it very well.
regards
Bernd