Hi All, Here i am facing a problem while using a single surface for image and text.
I created a Image Provider with a JPEG image and getting the dimension of the image by using GetSurfaceDescription(). and created a surface with dimensions more than image surface and using same surface for image and text but it not displaying the text it only displaying the Image.Here below is the code.Please let know how solve it. DFBCHECK (DirectFBInit (&argc, &argv)); DFBCHECK (DirectFBCreate (&dfb)); DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)); dsc.flags = DSDESC_CAPS; dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING; dsc.pixelformat = DSPF_ARGB; /* Creating primary fb0 surface */ DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary )); /* Get the Size of the Primary surface */ DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height)); printf("Primary width %d Primary Height %d\n",screen_width,screen_height); /* Clear the Primary surface */ DFBCHECK(primary->Clear(primary,0xFF,0xFF,0xFF,0xFF)); /* Setting Blending flags for the Primary Surface */ DFBCHECK(primary->SetBlittingFlags(primary,(DSBLIT_BLEND_ALPHACHANNEL ))); DFBCHECK(primary->SetPorterDuff(primary,DSPD_SRC_OVER)); /* Creating the Font Interface with fontdsc descriptions */ memset(&fontdsc,0,sizeof(DFBFontDescription)); fontdsc.flags = DFDESC_HEIGHT; fontdsc.height = 30; DFBCHECK(dfb->CreateFont(dfb,DATAdirectory,&fontdsc,&font)); /* Creating the a image provider */ DFBCHECK (dfb->CreateImageProvider (dfb, image,&provider)); /* Getting the Image Dimensions width and Height */ DFBCHECK(provider->GetSurfaceDescription(provider,&jpegimagedsc)); memset(&dsc,0,sizeof(DFBSurfaceDescr)); dsc.width = jpegimagedsc.width+100; dsc.height = jpegimagedsc.height+100; /* Creating a surface with name JPEG */ DFBCHECK(dfb->CreateSurface(dfb,&dsc,&jpeg)); /* Rendering the image to jpeg surface at a specific position */ rect.x = 0; rect.y = 0, rect.w = jpegimagedsc.width; rect.h = jpegimagedsc.height; DFBCHECK(provider->RenderTo(provider,jpeg,&rect)); /* Drawing a String */ DFBCHECK(jpeg->SetColor(jpeg,0xFF,0x00,0x00,0xFF)); DFBCHECK(jpeg->DrawString(jpeg,"string",-1,0,rect.h+50,DSTF_BOTTOM)); DFBCHECK(primary->Blit(primary,jpeg,NULL,100,100)); DFBCHECK(primary->Flip(primary, NULL, DSFLIP_NONE));
_______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users