> so how does that work? What's it really doing? Pixel values are represented by RGB values + an 'alpha' channel. The Alpha channel controls the level of translucency of the color. We are working with bytes, so the alpha range is 0-255 0 means 'completely transparent'. 255 means 'completely opaque'. A value of 128 would mean 'half translucent'. We only use values of 0 & 255. Other alpha channel values are somewhat complicated in that they must read the current pixel color value and 'mix' the colors based upon the alpha channel.
If the alpha value is 255 then pixel is completely opaque and the destination pixel gets set without regard to what was there. If the alpha value is 0 then the pixel is completely transparent ant the destination pixel is left unmodified. This is completely independent of what the 'RGB' values are ... because they are transparent. Under normal conditions, we start the paint cycle by filling the pixel buffer with the background color ... opaque with an alpha channel of 255. All colors that are written to the pixel map contain an alpha channel value of 255. Later, when that pixel map gets written to the screen (indirectly through several layers of software), the old 'screen buffer' gets overwritten completely by the opaque pixels that are coming in. When we say 'color background none' we fill the pixel buffer with transparent alpha channel values of zero. We then render the scene, and some pixels get set to opaque colors ... only the places where we draw. That image then gets blitted to the screen buffer. But, only the pixels that are opaque get written, the transparent pixels get skipped. What remains are pixels from the previous rendering that do not get overwritten. I have not tried this on Windows, but on Linux there are some interesting things that happen. For example, if you resize the window then you can get some interesting effects. When Charles asked me for this functionality I told him that I saw no reason for it. He then showed me some static screen shots where they had put text/images in the background. That is, they rendered some stuff, then overlaid the Jmol output on top of it. It looked pretty cool. Not sure exactly how we could use this within the applet or application. But this technique would allow one to overlay on top of a logo, photo, or other image. It would be interesting if the browser had some concept of an applet being translucent/floating, but I don't think that will happen any time soon. Miguel ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Jmol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-developers
