Page 1 of 1

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

Posted: Wed Sep 07, 2011 5:40 am
by BarrySumpter
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

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

Posted: Wed Sep 07, 2011 6:09 am
by BarrySumpter

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?

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

Posted: Wed Sep 07, 2011 12:16 pm
by BarrySumpter

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

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

Posted: Wed Sep 07, 2011 6:21 pm
by jacque
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

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

Posted: Fri Sep 09, 2011 12:20 am
by BarrySumpter
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"?