PolyList and Image data

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pink
Posts: 280
Joined: Wed Mar 12, 2014 6:18 pm

PolyList and Image data

Post by pink » Sun Jul 28, 2024 5:41 pm

I am trying to use the PolyList widget, however I cannot get the image-data to display.

This is very simple setup... I have a PolyList that only has the item "image" which is set to the content type of "image-data". There are 2 images in the card that I am testing with.

I have the following button set to add the imageData to the Polygrid. The data is in the array, but nothing is being displayed.

Code: Select all

on mouseUp
   put the imageData of image "a1" into tData[1]["image"]
   put the imageData of image "a2" into tData[2]["image"]
   set the dataContent of widget "PolyList" to tData
end mouseUp
Because the images make the file too large, I can't attach, so here's my test stack: https://u.pc.cd/qsM

Any thoughts as to what I'm missing?
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PolyList and Image data

Post by Klaus » Sun Jul 28, 2024 5:58 pm

Hi Greg,

putting "the imagedata" of an image into another image requires that both source and target image have the SAME dimensions (height and width).
Otherwise it will not work andI think this also applies to "PolyList" widgets.


Best

Klaus

pink
Posts: 280
Joined: Wed Mar 12, 2014 6:18 pm

Re: PolyList and Image data

Post by pink » Sun Jul 28, 2024 9:07 pm

So I added 128x128 images to the stack, and set the size of the item (Columns tab) to 128x128, and the item height of the item to 128 and the width of the column to 128.

Still no luck.
Attachments
PolyList Test.livecode.zip
(129.87 KiB) Downloaded 414 times
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

pink
Posts: 280
Joined: Wed Mar 12, 2014 6:18 pm

Re: PolyList and Image data

Post by pink » Sun Jul 28, 2024 9:18 pm

also trying to fool around with the PolyGrid with the same results
Attachments
PolyList and PolyGrid Test 2.livecode.zip
(172.41 KiB) Downloaded 420 times
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: PolyList and Image data

Post by bn » Sun Jul 28, 2024 10:45 pm

pink wrote:
Sun Jul 28, 2024 9:07 pm
So I added 128x128 images to the stack, and set the size of the item (Columns tab) to 128x128, and the item height of the item to 128 and the width of the column to 128.

Still no luck.
Hi Greg,

I tried your example stack: no luck.

Out of "desperation" and a little suspicion* I changed "imageData" to image:

Code: Select all

on mouseUp pMouseButton
   put image "a1" into tData[1]["image"]
   put image "a2" into tData[2]["image"]
   set the dataContent of widget "PolyList" to tData
end mouseUp
That worked. Your images are shown in widget "PolyList"
I tested your second stack and for PolyGrid it is the same.

Who would've thunk?

Kind regards
Bernd

* suspicion because there are other instances in the terminology of Poly-Grig/List that are "strange"

pink
Posts: 280
Joined: Wed Mar 12, 2014 6:18 pm

Re: PolyList and Image data

Post by pink » Mon Jul 29, 2024 1:52 am

thanks Bernd, I wouldn't have thought of that

Also, just so it is listed somewhere, the size of the item/column/row DOES NOT have to be the same as the image being put into it.

The content fit of the item (fill, cover, or contain) will fit the image regardless of the size of the original.
Greg (pink) Miller

MadPink, LLC
I'm Mad, Pink and Dangerous to Know

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PolyList and Image data

Post by Klaus » Mon Jul 29, 2024 9:16 am

AHA! :D

Thanks for the info!

Post Reply