Mark wrote:You're confusing text and image data. Text is the picture data from a picture file, like JPEG or PNG. Imagedata is a LiveCode-specific format and is not the same as picture data.
I have tried both, and couldn't get it to work either way.
Mark wrote:Once you get the imagedata of an image control, the only way to display this imagedata again is by setting the imagedata property. If you set the text of an image control to imagedata, you get a corrupt image (and sometimes a crash).
But it didn't work when I grabbed the imageData of the placeholder and tried to set that in the data grid row behavior script.
Mark wrote:You should not set the lockLoc of an image to true before you set the text of the image. You need to change the size of an image and set the lockLoc after setting the text.
It was locked in the editor, I don't think that is the same thing as lockLoc, is it? I did not set lockLoc in my scripts.
Mark wrote:Before you set the imagedata of an image, you need to make sure that the width and height of the image are correct. This is exactly the opposite of when you set the text.
The image in the data grid is 75 x 75 which is what I set the placeholder to before I grabbed the imageData.
I really appreciate all the help, but it looks like short of finding a working example I don't know that I'll get this sorted out because everything I try keeps falling over. Any explanation for the odd behavior where the image data in the data grid CHANGES as you move the rows up and down in the list scroller? That just blows my mind.
Just to be clear, here is the actual code producing this:
Code: Select all
put URL imageURL into image "webImage" of card "Images" of stack "Resources"
set the width of image "webImage" of card "Images" of stack "Resources" to 75
set the height of image "webImage" of card "Images" of stack "Resources" to 75
put the imageData of image "webImage" of card "Images" of stack "Resources" into storyGridData[storyCount]["colImage"]
put empty into image "webImage" of card "Images" of stack "Resources"
Then in the row behavior script in FillInData:
Code: Select all
set the imageData of image "Image" to pDataArray["colImage"]
EDIT: The last bit above in the behavior script should be:
Code: Select all
set the imageData of image "Image" of me to pDataArray["colImage"]
That seems to have sorted the image changing problem. Small oversight with big problem.

Now back to the resizing issue, but with this introduced bug out of the way it should be easier.
