How do you add icons to a stack?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How do you add icons to a stack?
I converted a Hypercard stack to a Revolution stack, and all the icons came along. Yay. I see them when I select an icon for a button, using the inspector. I can uset the "set icon of btn..." command to disaply them. The icons are not part of the image library, which is empty.
In trying to add icons to the rev stack, the only method I've found is to import a file into the image library. The image is then available as an icon.
The problem is that this automatically plops the image down onto the card, where I don't want it. I want it to be an icon stored in the stack, summoned by the "set icon..." command. I don't want it to be a graphic object independent of existence as an icon.
The really tedious way to do this would be to add the new icon I want to a Hypercard stack, and then convert the Hypercard stack. Surely there is a better way....
In trying to add icons to the rev stack, the only method I've found is to import a file into the image library. The image is then available as an icon.
The problem is that this automatically plops the image down onto the card, where I don't want it. I want it to be an icon stored in the stack, summoned by the "set icon..." command. I don't want it to be a graphic object independent of existence as an icon.
The really tedious way to do this would be to add the new icon I want to a Hypercard stack, and then convert the Hypercard stack. Surely there is a better way....
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Re: How do you add icons to a stack?
The icons that came along from the HyperCard conversion, are actually stored as image controls in your stack, and simply hidden.
So when you import new icons, all you have to do is hide the images after import.
Jan Schenkel.
So when you import new icons, all you have to do is hide the images after import.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: How do you add icons to a stack?
Hi. That can't be right, because the imported icons aren't listed in the image library. They are only presented when I select an icon for a button using the object inspector.
It seems cleaner to do it that way. I don't want random images that will never be displayed, except as button icons, scattered and hidden on random cards.
It seems cleaner to do it that way. I don't want random images that will never be displayed, except as button icons, scattered and hidden on random cards.
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Re: How do you add icons to a stack?
The image library is actually a completely separate stack. When you use the inspector to assign an icon to your button, you've probably switched to 'This stack' and seen the list of your old icons, converted from HyperCard. And yes, those are actually image controls in your stack, hidden from sight, but perfectly selectable as an icon.
The advantage of this LiveCode feature, is that you're not limited to a specific icon size or file type - just use any image. The image doesn't even have to be in the same stack file - as it can be stored in a substack; then all you need to remember is the ID of the image, and you can assign it directly in the inspector.
Jan Schenkel.
The advantage of this LiveCode feature, is that you're not limited to a specific icon size or file type - just use any image. The image doesn't even have to be in the same stack file - as it can be stored in a substack; then all you need to remember is the ID of the image, and you can assign it directly in the inspector.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Re: How do you add icons to a stack?
I've gone ahead and started using icons this way. Now the problem is the Revolution doesn't seem to recognize transparent areas in a png image. I displays the areas between the actual image and the sides of the rect as white, no matter what I do. Does Revolution recognize transparency?
Re: How do you add icons to a stack?
Hi noloop,
Rev honors the transparencies of a png. Once imported you can actully play with the transparency of an image object which is the alphadata. I don't quite get what you are seeing. Would it be possible to upload a small example? And a zipped version of a png you are using?
regards
Bernd
Rev honors the transparencies of a png. Once imported you can actully play with the transparency of an image object which is the alphadata. I don't quite get what you are seeing. Would it be possible to upload a small example? And a zipped version of a png you are using?
regards
Bernd
Re: How do you add icons to a stack?
Hello. This rev stack contains a .png image that has a trnasparent background (according to GraphicConverter). The transparent background is opaque white on the card.
I've noticed that if I go into "Blend" and choose transparent, that it works. But it's buggy in certain situations, such as unlock screen with visual "wipe right". Also, I don't think that can be the correct solution, because it seems to work (sort of) regardless of whether the background of the image is set to transparent or white.
I've noticed that if I go into "Blend" and choose transparent, that it works. But it's buggy in certain situations, such as unlock screen with visual "wipe right". Also, I don't think that can be the correct solution, because it seems to work (sort of) regardless of whether the background of the image is set to transparent or white.
- Attachments
-
- pngtest.rev.zip
- (1.17 KiB) Downloaded 293 times
Re: How do you add icons to a stack?
FYI, when I opened the stack both images were transparent for me. I'm running Vista x64 on an NVIDIA 9200M.
Walt
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: How do you add icons to a stack?
That's weird. I'm running Revolution 3.5 on Mac OS 10.5.8
Re: How do you add icons to a stack?
Just to add information:
RevMedia 4.0
Mac OS 10.6.4
I see black figures on white squares on a blue field.
I tried gifs that I had saved with as few colors as possible to get rid of the grayed pixels on the edges that looked like white specks around my images (though one refused to work that way and I had to go in and remove each of them one by one) Those did work, but I wasn't happy with where the name of the button kept ending up, so I used the images grouped with transparent buttons. I'm going to try again soon to use them as icons, though.
Cheers,
Bantymom
RevMedia 4.0
Mac OS 10.6.4
I see black figures on white squares on a blue field.
I tried gifs that I had saved with as few colors as possible to get rid of the grayed pixels on the edges that looked like white specks around my images (though one refused to work that way and I had to go in and remove each of them one by one) Those did work, but I wasn't happy with where the name of the button kept ending up, so I used the images grouped with transparent buttons. I'm going to try again soon to use them as icons, though.
Cheers,
Bantymom
2nd-grade Teacher, Poultry Fancier, Scottish Country Dancer
and Perpetual Beginner
and Perpetual Beginner
Re: How do you add icons to a stack?
Hi noloop,
I don't know why transparency works for Walt but not for you, bantymon nor me. All three of us on a Mac. You can create PNGs with or without alphachannel = transparency. It would be interesting if Preview shows transparency or not. Maybe there is something wrong with your PNGs.
Anyhow, to show that PNGs work with rev I took your stack, copied the image, renamed it and did this:
choose any color of the bucket tool colors, choose the bucket tool, then right-click in a white portion of the image. This is an eraser function taking color information from the image and making it transparent.
In the attached stack I added a button to export this modified image to the desktop (look at it in Preview, it is called "emptyHandedII.png") and then reimport it with the button below the export button. -> with transparency.
regards
Bernd
I don't know why transparency works for Walt but not for you, bantymon nor me. All three of us on a Mac. You can create PNGs with or without alphachannel = transparency. It would be interesting if Preview shows transparency or not. Maybe there is something wrong with your PNGs.
Anyhow, to show that PNGs work with rev I took your stack, copied the image, renamed it and did this:
choose any color of the bucket tool colors, choose the bucket tool, then right-click in a white portion of the image. This is an eraser function taking color information from the image and making it transparent.
In the attached stack I added a button to export this modified image to the desktop (look at it in Preview, it is called "emptyHandedII.png") and then reimport it with the button below the export button. -> with transparency.
regards
Bernd
- Attachments
-
- pngQuestion.rev.zip
- (2.26 KiB) Downloaded 291 times
Re: How do you add icons to a stack?
For me, that works for the image, but not when using the image as a button icon. It's still white where it should be transparent. Hm....
Re: How do you add icons to a stack?
noloop,
if I set the button icon to the id of the reimported png it is transparent.
Please have a look at the stack I appended to above message.
Edit: I just did it on a image that was defined an icon to the button and took away the white part with the bucket tool right click. When I went back to browse mode it had not updated the icon on the button yet. Switching to edit mode and back to browse mode updated the icon in the button. Could you try that?
regards
Bernd
if I set the button icon to the id of the reimported png it is transparent.
Please have a look at the stack I appended to above message.
Edit: I just did it on a image that was defined an icon to the button and took away the white part with the bucket tool right click. When I went back to browse mode it had not updated the icon on the button yet. Switching to edit mode and back to browse mode updated the icon in the button. Could you try that?
regards
Bernd
Re: How do you add icons to a stack?
Brrnd, on your stack, the two images on the right are transparent EXCEPT between the legs of the dancer. Here is a JPEG of part of my screen showing both stacks. In Bernd's, I have clicked Export then Re-Import once each.
Walt
Walt
- Attachments
-
- IconStacksImage.jpg (65.29 KiB) Viewed 9109 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: How do you add icons to a stack?
And here is a JPEG of the original PNG copied and pasted into Gimp, which clearly shows the alpha.
Walt
Walt
- Attachments
-
- FirstIconStackImage.jpg (98.49 KiB) Viewed 9108 times
Walt Brown
Omnis traductor traditor
Omnis traductor traditor