Well I have other things on my screen drawn out such as the following:

//this is my window
Main {
..............
        ...
        rect.x = 0; rect.y = 0; rect.w = 320; rect.h = 240; //Screen
dimensions
        lite_new_window( NULL, &rect, DWCAPS_NODECORATION,
liteNoWindowTheme, NULL, &screen );

        lite_set_window_background_color( screen, white.r, white.g, white.b,
white.a ); 
        lite_hide_cursor();
        lite_set_window_opacity( screen, liteFullWindowOpacity );
        ...
        Function1
        Function2
        ...
}


//I am placing this image on one location, and I want to draw on top of it
(you can see the coordinates are similar in the code below)
Function1{      
        DFBRectangle rect;
        LiteImage    *image;

        /* setup image */
        rect.x = 185; rect.y = 4; rect.w = 56; rect.h = 20;
        lite_new_image(LITE_BOX(window), &rect, liteNoImageTheme, &image);

        lite_load_image( image, "image.png" ); 
}

//And then I attempt to draw a figure:
Function2{      
        static IDirectFBSurface *batt = NULL;
        static LiteBox *batt_stat = NULL;
        static DFBRectangle batt_rect[2];

        batt_rect[0].x = 188; batt_rect[0].y = 7; batt_rect[0].w = 47;
batt_rect[0].h = 14;
        batt_rect[1].x = 235; batt_rect[1].y = 9; batt_rect[1].w = 3;
batt_rect[1].h = 10;

        lite_new_box( &batt_stat, LITE_BOX(window), 188, 7, 50, 14 );
        lite_init_box( batt_stat );

        batt = batt_stat->surface;

        batt->SetColor( batt, green.r, green.g, green.b, green.a );  //green
        batt->FillRectangles( batt, batt_rect, 2 );
        batt->Flip( batt, NULL, 0 );
}



I have defined green as the following:
static DFBColor green   = {0xff, 0x2A, 0xff, 0x02 };



V/R,
Bryan



> -----Original Message-----
> From: Denis Oliver Kropp [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2008 2:22 PM
> To: Bryan Bui-Tuong
> Cc: directfb-users@directfb.org
> Subject: Re: [directfb-users] LiTE: Drawing functions or drawing on top
> of a window
> 
> Bryan Bui-Tuong wrote:
> > I tried to do something similar to that of the wiki code snippet and
> got
> > nothing.  Is there something I am missing here?
> 
> Nothing or black?
> 
> >
> > Function {
> >     static IDirectFBSurface *batt = NULL;
> >     static LiteBox *batt_stat = NULL;
> >     static DFBRectangle batt_rect[2];
> >
> >     batt_rect[0].x = 188; batt_rect[0].y = 7; batt_rect[0].w = 47;
> > batt_rect[0].h = 14;
> >     batt_rect[1].x = 235; batt_rect[1].y = 9; batt_rect[1].w = 3;
> > batt_rect[1].h = 10;
> >
> >     lite_new_box( &batt_stat, LITE_BOX(window), 188, 7, 50, 14 );
> >     lite_init_box( batt_stat );
> >
> >     batt = batt_stat->surface;
> >
> >     batt->SetColor( batt, green.r, green.g, green.b, green.a );
> //green
> 
> How's green defined?
> 
> >     batt->FillRectangles( batt, batt_rect, 2 );
> >     batt->Flip( batt, NULL, 0 );
> 
> 
> --
> Best regards,
>    Denis Oliver Kropp
> 
> .------------------------------------------.
> | DirectFB - Hardware accelerated graphics |
> | http://www.directfb.org/                 |
> '------------------------------------------'



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

Reply via email to