Grayed image on the web with the revlet
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 2
- Joined: Fri Jan 15, 2010 7:54 am
Grayed image on the web with the revlet
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
Help
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
Help
Re: Grayed image on the web with the revlet
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Grayed image on the web with the revlet
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
because that is filepath to the image 'warpaint.jpg'
be well
Dixie
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
be well
Dixie
-
- Posts: 2
- Joined: Fri Jan 15, 2010 7:54 am
Re: Grayed image on the web with the revlet
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Grayed image on the web with the revlet
Thanks, this did the trick for me.Mark wrote:Make sure that you import the picture as a control, rather than referenced: File menu/Import as Control/Image File...
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
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 3990
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Grayed image on the web with the revlet
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.
now the images are not referenced anymore but resident in the stack, just like imported.
regards
Bernd
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
regards
Bernd
Re: Grayed image on the web with the revlet
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
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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 3990
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Grayed image on the web with the revlet
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
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
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Grayed image on the web with the revlet
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!bn wrote:you could comment out the formattedWidth/formattedHeight part of the script. It would reduce the size of the stack.
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist