[REBOL] Re: [View] invisible background
From: antonr::iinet::net::au at: 19-Nov-2003 0:58
You want to save the alpha channel.
The problem is that to-image render a representation
of the image without alpha channel. The btn style
uses an image with an alpha channel, but when it
is rendered to the screen, the alpha is lost.
Rendering takes the image, applies the extend and colorize
effects and adds text.
I don't have a solution yet, but I think you must
mimic the process of the btn style, layout and to-image.
Seems a lot of work, but maybe there is a way.
Here are some things I did while experimenting:
Let's look at the images that the btn styles uses:
view layout [b: btn]
view layout [image b/images/1 image b/images/2]
Let's create an image as you do below (using to-image) and reload it
(as if we saved and loaded a file).
bin: make binary! 10000
save/png bin img: to-image view center-face layout [origin 0 btn red
view center-face layout [backcolor orange pic: image 200x100 (load bin)
poke pic/image 1 pic/image/1 + 0.0.0.1 ; add alpha channel
; top-left alpha pixel must be non-zero to see any alpha at all in rebol.
view layout [image pic/image]
layout [b: btn red "pill"]
img: to-image b
view layout [image img]