gdk_pixbuf_composite_color() help needed.



I'm trying to overlay my application's logo over an empty space in my gtk+2
prog (MegaTunix).  In this mostly empty window exists a label and a
drawingarea, bothed packed into a vbox.  I've successfully setup the
expose/configure events modeling after the "testpixbuf" demo from the gtk+
source code. For the most part it works, EXCEPT I want to be able to display
the logo and have it blend in smoothly with the window no matter what color the
window may be (User may have a theme with different BG colors than mine, or a
pixmap background)

The only way I found thus far, was to retrieve the style of the parent widget
(the vbox in this case) and extract the bgcolor from it, the problem is it's a
GdkColor which stores the colors in 16 bit formats.  The
gdk_pixbuf_composite_color() accepts two colors  with 8 bits per component only
(I use the same color for each to avoid a checkerpattern) but in RGB packed
format (only 8 bits per R, G or B component).  In my conversion from 16 to 8, I
loose resolution and the composition ends up having a rectangular box (the size
of the drawingarea) that is close, but not exactly the same color as the rest
of the applications background color.  It works (with the slight color
mismatch) with theme changes as long as the theme doesn't use a pixmap
background (instead ofa solid color).

I want to be able to display my logo (which has an alpha channel) on one of my
app's panes (gtk_notebook used) and have it blend into the background properly
no matter if the user is running a pixmap style theme or an arbritrary color
schemed theme..  (it almost works for the latter, I have no idea how to do the
former..)

Anyone got any ideas?  I'm currently stuck at this point.


=====
Dave J. Andruczyk

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]