Hello,

I am having trouble getting transparent windows.

I am making an image slideshow and would like to write a title on top of
the image
with a background that is somewhat transparent. (The image is drawn to
the layer surface
and I want the text in a window)

I read that the window surface is created using the layers palette so I
tried setting
the layer background mode to DLBM_DONTCARE which made my windows
transparent just the
way i want them. But it seems DLBM_DONTCARE does not support clearing.

So I have been trying to give opacity capabilities to the layer and
setting the background
mode to DLBM_COLOR, hoping that I will be able to add transparency to my
windows but,
 so far i cant seem to get it to work.

I always end up with a window on top of my layer that that has no
opacity and is filled
with the same color as the layer background.

How do I add opacity to my windows?

Any help is appreciated.

Daniel

{
        DFBResult err;
        DFBSurfaceDescription dsc;

        DFBCHECK(DirectFBInit(&argc, &argv));
        DFBCHECK(DirectFBCreate(&dfb));

        dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );

        layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE );

        layer->GetConfiguration( layer, &layer_config );

        layer_config.flags = (DLCONF_PIXELFORMAT | DLCONF_OPTIONS);
        layer_config.pixelformat = DSPF_ARGB;
        layer_config.options = DLOP_OPACITY;

        layer->SetConfiguration( layer, &layer_config );

        layer->SetBackgroundMode(layer, DLBM_COLOR);
        layer->SetBackgroundColor( layer, 255, 100, 100, 128 );

//      layer->SetBackgroundMode(layer, DLBM_DONTCARE);

        layer->SetOpacity(layer, 128);
        layer->GetSurface(layer, &primary);

        primary->SetDrawingFlags(primary, DSDRAW_BLEND);

        DFBCHECK(primary->GetSize(primary, &xres, &yres));

        // create window
        DFBWindowDescription desc;

        desc.flags  = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT
| DWDESC_CAPS);
        desc.posx   = 100;
        desc.posy   = 100;
        desc.width  = 250;
        desc.height = 250;
        desc.caps   = DWCAPS_ALPHACHANNEL;

        layer->CreateWindow(layer, &desc, &window);
        window->GetSurface(window, &window_surface);
}



_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to