Let me clarify: you want to make the graphics layer transparent outside the 
area 
where an image has been drawn, so that the video layer may be seen through that 
outside region, but not through the image?

1) set the graphics layer to be above the video layer
2) clear the graphics layer to alpha zero opacity
3) draw the image with alpha set to fully opaque

Depending what exactly you require, you might be able to use other ways. For 
example if you only want to see the graphic image, overlaid on the video, then 
you could set the graphic layer to the size and position of the image and 
simply 
use 'AoverB' alpha blending with alpha of the graphics layer fully opaque. But 
if you have other drawing on the graphics layer which you want to see through 
where there is video underneath then you might again use AoverB but now make 
the 
video layer the size and position of the desired video. Or something like the 
brute force recipe I gave above.

If your review the section on Mixing on our DirectFB training web site you will 
find details - there are several ways to achieve the effect you describe, all 
of 
which depend on using the various alpha blend and color keying combinations. I 
suggest in particular you review the section on alpha blending rules and Porter 
Duff rules, these are the key to the different overlay effects.

Chris

 ==================================
Chris Bore
Training Director
BORES Signal Processing
ch...@bores.com
www.bores.com
+44 (0)1483 740138




________________________________
From: Pasha  <khajapasha...@rediffmail.com>
To: Chris Bore <chris_b...@yahoo.co.uk>
Cc: Defnet Benjamin <benjamin.r.def...@intel.com>
Sent: Tue, 4 January, 2011 14:48:21
Subject: Re: [directfb-users] How to Mix Windows to form a Display Layer

Hi Chris,

Thanks for Your replay.

After getting Graphics layer how can i make apart of the Graphic layer 
transparent so that when i plotting image on the Graphics layer at specific 
position, have to view video which playing on video layer from remaining 
graphic 
layer part (the space which is not filled by image).


Thanks In Advance.

--
Regards
Pasha.



On Tue, 04 Jan 2011 17:17:51 , Chris Bore <chris_b...@yahoo.co.uk> wrote

You mix layers by setting their alpha blend and color key properties, and their 
level in the layer stack.

Here is an extract that mixes two layers (one fed by a VideoProvider, the other 
by an ImageProvider in this example):


  dfb->GetDisplayLayer( dfb, dfbVideoLayer, &dfbI_VideoLayer);
  dfbI_VideoLayer->SetCooperativeLevel( dfbI_VideoLayer, DLSCL_EXCLUSIVE);
  dfbI_VideoLayer->SetLevel(1);
  dfb->GetDisplayLayer( dfb, dfbGfx0Layer, &dfbI_Gfx0Layer);
  dfbI_Gfx0Layer->SetCooperativeLevel( dfbI_Gfx0Layer, DLSCL_EXCLUSIVE);
  dfbI_Gfx0Layer->SetLevel(0);
  dfbI_VideoLayer->GetSurface( dfbI_VideoLayer, &dfbI_VideoSurface);
  dfbI_VideoProvider->PlayTo(dfbI_VideoProvider, dfbI_VideoSurface, NULL, NULL, 
NULL);
  dfbI_Gfx0Layer->GetSurface( dfbI_Gfx0Layer, &dfbI_Gfx0Surface );
  dfbI_ImageProvider->RenderTo(dfbI_ImageProvider, dfbI_Gfx0Surface, NULL, 
NULL, 
NULL);

 The extract does not show the blend and key properties being set.

Chris
==================================
Chris Bore
Training Director
BORES Signal Processing
ch...@bores.com
www.bores.com
+44 (0)1483 740138




________________________________
From: Pasha  <khajapasha...@rediffmail.com>
To: directfbusers <directfb-users@directfb.org>
Cc: Defnet Benjamin <benjamin.r.def...@intel.com>
Sent: Tue, 4 January, 2011 5:26:25
Subject: [directfb-users] How to Mix Windows to form a Display Layer

Hi All,

I am unable to mix two windows to form a DisplayLayer, how can i view window 
content on the screen.

Please let me know how to mix   1. a window with a Displayer, 2. How to mix two 
Displaylayers.3.How to mix multiple of windows to form a layer.


Thanks In Advance....

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

Reply via email to