i want transparency. my problem is as follow:-
there is only a single layer [primary layer]. On this layer, there is a
surface called primary_surface. I set background color white by using
DirectFBSetOption("bg-color", "00000000") . i have a picture in which
there is oval surrounded by white background(the image attach with this
mail Erawise.png). i have another picture background.png. when i paste
Erawise.png image on background image than i got black background arround
the oval. but i want to make it transparent (i.e. i want background image
around the oval like image EngFilmBg.png ).
how to do it?
with this mail some of portion of code attached check it.
void Draw_Image(IDirectFB *dfb, char *img, int width, int height, int lid,
int posx, int posy) {
pthread_mutex_lock( &mutex1 );
DFBSurfaceDescription sdesc;
DFBCHECK (dfb->CreateImageProvider (dfb, img, &provider));
DFBCHECK (provider->GetSurfaceDescription (provider, &sdesc));
sdesc.width = width; sdesc.height = height;
DFBCHECK (dfb->CreateSurface (dfb, &sdesc, &surface));
DFBCHECK (provider->RenderTo (provider, surface, NULL));
provider->Release (provider);
DFBCHECK (pFrameBuffer->Blit (pFrameBuffer, surface, NULL, posx,
posy));
DFBCHECK (pFrameBuffer->Flip (pFrameBuffer, NULL,
DSFLIP_WAITFORSYNC));
DFBCHECK (pFrameBuffer->Flip (pFrameBuffer, NULL, 0));
surface->Release(surface);
pthread_mutex_unlock( &mutex1 );
}
main(){
DirectFBSetOptions("bg-color", "00000000");
.
.
.
DFBCHECK( (dfbLayers[0])->GetSurface(dfbLayers[0],
&pFrameBuffer));
Draw_Image(dfb, "background.png", 640, 480, 0, 0 , 0);
Draw_Image(dfb, "Erawise.png", 142, 97,0,80,110);
.
.
.
}
**pFrameBuffer is primary surface on primary layer (0).
Thanks
--
JOY
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users