Cropping a referenced image
Sannyasin Brahmanathaswami
brahma at hindu.org
Wed Aug 15 10:27:35 EDT 2018
Sometimes LiveCode astounds me...
Using Klause's method, plus Datagrid under the hood (and all its code)
1) the setting to Button icon to the size you want your image cropped, 120X74
2) Place an image off screen at +1000 to the right.
3) At 120x90 call it img "ytBtnIconTemplate"
I was able to fill the DataGrid with the images *in just SEVEN lines of code* !
on FillInData pDataArray
put pDataArray["ytThumb"] into tURL
set the itemdel to "/"; put item -2 of tURL into tImageName
if exists(img tImageName ) = false then
clone img "ytBtnIconTemplate" as tImageName
set the filename of img tImageName to pDataArray["ytThumb"]
end if
set the icon of button "ytThumb"of me to (the id img tImageName)
set the text of field "collectionTitle" of me to pDataArray["collectionTitle"]
end FillInData
More information about the use-livecode
mailing list