Can't seem to copy one image to another wtih ImageID

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: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Can't seem to copy one image to another wtih ImageID

Post by BarrySumpter » Wed Sep 07, 2011 5:40 am

I CAN do this:

Code: Select all

   set the icon of btn "myPNGImageButton" of me to tPNGID
But Not this: no error just doesn't work

Code: Select all

put the imageData of image tPNGID into tImageTarget
   set the imageData of image "myPNGImage" to tImageTarget
   
Nor this: errors

Code: Select all

   set the image of image "myPNGImage" to tPNGID
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can't seem to copy one image to another wtih ImageID

Post by BarrySumpter » Wed Sep 07, 2011 6:09 am

Code: Select all

put the image ID tPNGID into image "myPNGImage"
works in a normal button on a normal card

But not in a FillinData function in a DataGrid Column Behaviour.
Is the image control limited in the DataGrid Column Behaviour?
Last edited by BarrySumpter on Fri Sep 09, 2011 12:01 am, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can't seem to copy one image to another wtih ImageID

Post by BarrySumpter » Wed Sep 07, 2011 12:16 pm

Code: Select all

put the icon of  button "Currency_PNG2" into tPNGID 
   
   switch myImageID
      case 1166
         put 1167 into tPNGID
         break
      case 1167
         put 1166 into tPNGID
         break
      case 0
         put 1166 into tPNGID
         break
      case Empty
         put 1166 into tPNGID
         break
      default
         put 1166 into tPNGID
   end switch
   
   --put the image ID tPNGID into image "Currency_PNG2" 
   set the icon of btn "Currency_PNG2" of me to tPNGID
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7392
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can't seem to copy one image to another wtih ImageID

Post by jacque » Wed Sep 07, 2011 6:21 pm

The quickest way is:

put img id tID into img "otherImg"

Which is equivanent to:

set the text of img "otherImg" to the text of img id tID
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can't seem to copy one image to another wtih ImageID

Post by BarrySumpter » Fri Sep 09, 2011 12:20 am

Along these same lines of working inside the DataGrid Column Behavior script :

This works:

Code: Select all

   
   Put 1059 into chkWhiteSquareOn
   Put 1060 into chkWhiteSquareOff



I'd like to refer to the image by name
instead of having to always chase down the Image ID for the exact same image on different stacks.

This works in a normal button on a new stack.
Where the image is placed on the stack.

But errors inside the DataGrid Column Behavior script.
Where the optTransparentCircleOn.png is in the DataGrid Row Template.

Code: Select all

    put the ID of image "optTransparentCircleOn.png" of me into chkWhiteSquareOn
    put the ID of image "optTransparentCircleOff.png" of me into chkWhiteSquareOff
Is there a way to qualify the image location instead of using "of me"?
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply