Create image in another card

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Create image in another card

Post by CenturyMan1979 » Mon Mar 11, 2013 5:43 pm

Hey All,

Is there a way to create an image in a card that is not the current card? Wanted to create a card that could be used to preload images into it but can't seem to figure out how to do it.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Create image in another card

Post by sturgis » Mon Mar 11, 2013 6:21 pm

The easiest way is something like this.

Code: Select all

   lock screen -- keeps the changes from showing
   go card "imagesC" -- card where you want the image
   create image "newImage" -- create the image (could be an import or whatever)
   go card "mainC" -- go back to your start card
   unlock screen 

CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Re: Create image in another card

Post by CenturyMan1979 » Mon Mar 11, 2013 7:50 pm

Thanks for the idea sturgis but that will not work to well for the way my application is setup. I did end up finding a way to load images into a card that is not the current card.

You need to create a group in the card you want to create the images in, then you can use the following code,

Code: Select all

create image in group "groupName" of card "cardName"

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Create image in another card

Post by sturgis » Mon Mar 11, 2013 8:45 pm

Yep that works too. Glad you found a way that will fit into your app!

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Create image in another card

Post by mrcoollion » Fri Jul 08, 2016 9:33 pm

Maybe an old post but just for the fun of it..

I solved this issue without using a group with an invisible dummy image ''CopyImage"

Code: Select all

      copy image "CopyImage" of this card to card "Imageholder"
      set the name of image "CopyImage" of  card "Imageholder" to newimagename

Post Reply