Image position

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Image position

Post by SEAL29 »

When i make the scrollable group and after i place the image (with button) and when i scroll the image stays in one place it always stays on top wherever i scroll.
How can images be placed in a larger area than the size of the stack?
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Image position

Post by Klaus »

That means the image is NOT part of your group, so it will be always "on top" of your scrolling group.
How did you import your image?

But what do you mean with:
How can images be placed in a larger area than the size of the stack?
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Image position

Post by jmburnod »

Hi Seal,
Are you sure your image is in your group ?
Jean-Marc
https://alternatic.ch
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Image position

Post by SEAL29 »

The image adding after groupping in stendalone application. I wanted to make it 40-45 images in one page and this add within a stendalone application.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Image position

Post by Klaus »

SEAL29 wrote: Tue Oct 20, 2020 6:16 pmThe image adding after groupping in stendalone application.
Yes, we guessed that, but you need to modify your import image script to make the image part of your group, so please show us the script!
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Image position

Post by SEAL29 »

Now i use this script.

Code: Select all

on mouseup
   ## Show the system OPEN dialog:
   answer file "Please select an image file." with type "Images|jpg,jpeg,gif,png|" 
   
   put it into tFile
   
   ## Check if user clicked CANCEL
   if the result = "Cancel" then
      exit mouseup
   end if
   
   create image "pic1"
   set the filename of img "pic1" to tFile
   set the resizeQuality image "pic1" to "best"
   set the rect image "pic1" to "1203,174,1914,574"
   ## ...
end mouseup
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Image position

Post by Klaus »

Ah, thank you.
Just add this to the line -> create image

Code: Select all

...
## create image "pic1"
create image "pic1" IN GROUP "Name of your scrolling group here"
## That's it! :-)
set the filename of img "pic1" to tFile
...
But this way you will end with LOTS OF images named -> pic1 in your group!
Better renumber your images like this in the same script:

Code: Select all

...
## create image "pic1"
## First get the number of images in your group:
put the number of images of grp "Name of your scrolling group here" into tNumOfImages

## We raise this number by ONE:
add 1 to tNumOfImages
put "pic" & tNumOfImages into tImageName

## Now create an image with that new name:
create image tImageName IN GROUP "Name of your scrolling group here"
## That's it! :-)
set the filename of img tImageName to tFile
...
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Image position

Post by SEAL29 »

Thank you.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: Image position

Post by dunbarx »

Seal29
put "pic" & tNumOfImages into tImageName
Do you see how this works? And how much fun LC can be?

Craig
SEAL29
Posts: 63
Joined: Fri Oct 02, 2020 3:32 pm

Re: Image position

Post by SEAL29 »

Yes i see. :)
Post Reply