Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: [View] invisible background

From: antonr::iinet::net::au at: 19-Nov-2003 0:58

You want to save the alpha channel. Good question... 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 pill ] view center-face layout [backcolor orange pic: image 200x100 (load bin) effect [merge]] poke pic/image 1 pic/image/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] Anton.