On Wed, Apr 21, 2010 at 10:28:46AM +0200, Johannes Hofmann wrote:
On Wed, Apr 21, 2010 at 05:01:11AM +0000, corvid wrote:
Is this anywhere near correct?
It is definately better than what we have now, but somehow this image background handling is a bit of a hack all together. Basically the Image Widget should get the background color via Widget::getBgColor() at drawing time. That would avoid any special handling in html.cc and would allow to modify the background color by setting a different style. However I can't see any easy way to achive this atm.
It seems that dw/imgbuf.hh supports RGBA images already. We probabely want to use them instead of just RGB with merged in background color. Otherwise we will have problems as in the following example (due to the shared image buffer): <div style="background-color: green"> <img src="http://www.libpng.org/pub/png/img_png/stefan_pal_rgba.png" /> </div> <div style="background-color: red"> <img src="http://www.libpng.org/pub/png/img_png/stefan_pal_rgba.png" /> </div> Cheers, Johannes