Hi,
I Think you should add "DSDESC_PIXELFORMAT" to dsc.flags
otherwise the pixelformat won't be take in consideration.

regards.

On Thu, Nov 4, 2010 at 2:48 PM, Andre DRASZIK <[email protected]> wrote:

> Hi,
>
> On Thu, 2010-11-04 at 14:18 +0100, Pasha wrote:
> > 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
> > %dn",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->SetFont (jpeg, font));
> DFBCHECK (font->Release (font));
>
> > 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));
>
> should make it work.
>
>
> Cheers,
> Andre
>
>
> _______________________________________________
> directfb-users mailing list
> [email protected]
> http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
>



-- 
*
 _  _      _ _   _
| || |__ _(_) |_| |_  ___ _ __
| __ / _` | |  _| ' \/ -_) '  \
|_||_\__,_|_|\__|_||_\___|_|_|_|
*
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to