Page 1 of 1

Grayed image on the web with the revlet

Posted: Fri Jan 15, 2010 8:02 am
by thebluelion
Received from: Harry Wagendorp

Hi,

I used to operate with Hypercard, when it started, then after Hypercard stopped with Supercard. Also I did make a lot of applesctipts.
Then I tried Revolution Media in order to test a multiOs program. Splendid but ......
My built rev works OK, but after saving for the web , the image in the revlet grayed out. No image .....
I tried "Hello World" .... downloaded the rev and saved the revlet and that's OK.

So after I studied a lot of the marvelous documentation and did many searches on the forums but now I feel myself lost.

iMac9,1, Intel Core 2 Duo, 2.93 GHz, 4 GB
MacOs 10.6.2
Safari 4.0.4 in 32 bits mode
rev plugin installed

:shock: Help

Re: Grayed image on the web with the revlet

Posted: Fri Jan 15, 2010 12:27 pm
by Mark
Dear Harry,

Make sure that you import the picture as a control, rather than referenced: File menu/Import as Control/Image File...

Btw since you have a Dutch family name, perhaps you're Dutch? There is a Dutch forum at http://runrev.info/rrforum/.

Best,

Mark

Re: Grayed image on the web with the revlet

Posted: Fri Jan 15, 2010 12:29 pm
by Dixie
the bluelion...

look at http://ihouse.on-rev.com/demo/index.html the web page contains a revlet that has one image object and one button...

the script of the button is

Code: Select all

on mouseUp
set the filename of image 1 to "http://ihouse.on-rev.com/demo/warpaint.jpg
end mouseUp 
because that is filepath to the image 'warpaint.jpg'

be well

Dixie

Re: Grayed image on the web with the revlet

Posted: Sat Jan 16, 2010 7:42 am
by thebluelion
Thanks for the help, I misinterpreted the import of images.
And yes, I'm Dutch, so I'll look at the Dutch forum.
As proof of the pudding, see: http://idisk.mac.com:80//harrywagendorp ... /test.html
N.B. This testpage will be there for one week.
:D

Re: Grayed image on the web with the revlet

Posted: Fri Mar 05, 2010 10:29 am
by thatkeith
Mark wrote:Make sure that you import the picture as a control, rather than referenced: File menu/Import as Control/Image File...
Thanks, this did the trick for me.

One question: is it possible to script the 'conversion' of a big set of graphics from file-referencing things to controls if they are already in a stack?

k

Re: Grayed image on the web with the revlet

Posted: Fri Mar 05, 2010 11:14 am
by bn
K,
you can "detach" the images from their file reference by setting their imagedata to the imagedata of themselves. (go figure). This does however affect those images that have been scaled down/up and that have their lockloc set to true. They are then set to the scaled size. That is not good if you want to zoom in and out of images or scale them afterwards in any way. To overcome this one sets width/height of the image to the formattedwidth and formattedHeight of the image. That is their original size. Then one sets them back to the current size. This keeps the original image information.
This little script does this, in my test it did worked, you might want to try this on a copy of your stack first and make shure it does not have untoward effects.

Code: Select all

on mouseUp
   push  card
   repeat with c = 1 to the number of cards
      go card c
      repeat with i = 1 to the number of images of this card
         if the filename of image i is not empty then
            lock screen
            put the rect of image i into tCurrentSize
            set the width of image i to the formattedWidth of image i
            set the height of image i to the formattedHeight of image i
            set the imagedata of image i to the imagedata of image i
            set the rect of image i to tCurrentSize
            unlock screen
         end if
      end repeat
   end repeat
   pop  card
end mouseUp
now the images are not referenced anymore but resident in the stack, just like imported.
regards
Bernd

Re: Grayed image on the web with the revlet

Posted: Fri Mar 05, 2010 11:23 am
by Mark
Hi Bernd,

I started writing an example script and then decided I didn't have the time to check whether the imagedata would be sufficient. One might want to check the maskdata and alphadata as well. It might also be possible to use the text of the image instead of the imagedata, maskdata and alphadata.

Best,

Mark

Re: Grayed image on the web with the revlet

Posted: Fri Mar 05, 2010 12:49 pm
by bn
Hi Mark,
I tried setting the text of image x to the text of image x, somehow it did not work (why?). Imagedata worked. I did not try this at this time, but in former tests the maskdata and the alphadata adjust to the imageData.
Although sometimes imagedata is still baffling me, e.g. when creating an image and strictly painting with the paint tools does not give me imagdata??, text of image works. e.g. testing whether the image has changed.

@ Keith: if you want to crop your referenced images permanently to the size they are displayed at (in case you resized them) you could comment out the formattedWidth/formattedHeight part of the script. It would reduce the size of the stack.

regards
Bernd

Re: Grayed image on the web with the revlet

Posted: Tue Mar 23, 2010 2:16 pm
by thatkeith
bn wrote:you could comment out the formattedWidth/formattedHeight part of the script. It would reduce the size of the stack.
Hi Bernd - I remember doing this many years ago in SuperCard, setting the pictureData of an image to itself (I forget the exact wording) in order to throw away unnecessary embedded pixel data. Thanks for the script, I'll play with it. It all helps learning and relearning!

k