Dear All,
I have to implement a "telop" player function on a STB device just like
"marquee" html tag effect on browser.
I found that if I update the contents on surface very quickly, the string
shown on screen seems not very clear.
The following are my sample codes, I'll be very appreciate for your time to
read.
#############################################################
{
// create font.
// create window
window->GetSurface(window, &surface);
// ......
//.......
strcpy(str,"TELOP TEST START: TELOP TEST START: TELOP TEST START: TELOP
TEST START:");
{
DFBSurfaceDescription desc;
desc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH |
DSDESC_HEIGHT);
desc.width = 650;
desc.height = 50;
DFBCHECK (dfb->CreateSurface(dfb, &desc, &tmp));
DFBCHECK (tmp->Clear(tmp,0xff,0xff,0x00,0xff));
}
tmp->SetFont(tmp, font);
tmp->SetColor(tmp,0xff,0xff,0x00,0xff);
tmp->FillRectangle(tmp,0,0,POS_W,50);
tmp->SetColor(tmp,0x00,0x00,0x00,0xff);
tmp->DrawString(tmp, str, strlen(str), 10, font_height+10, DSTF_LEFT);
{
DFBSurfaceDescription desc;
desc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH |
DSDESC_HEIGHT);
desc.width = 650;
desc.height = 50;
DFBCHECK (dfb->CreateSurface(dfb, &desc, ©));
copy->SetColor(copy,0xff,0xff,0x00,0xff);
DFBCHECK (copy->Clear(copy,0xff,0xff,0x00,0xff));
}
{
DFBRectangle rect={70,70,650,50};
surface->GetSubSurface(surface, &rect, &sub);
sub->SetClip(sub,NULL);
}
while(cnt<3)
{
for(i=0;i<80;i++)
{
DFBRectangle rect={i*8,0,650,50};
copy->FillRectangle(copy,0,0,650,50);
copy->Blit(copy,tmp,&rect,0,0);
sub->Blit(sub,copy,NULL,0,0);
surface->Flip(surface, NULL, 0);
// sleep 0.6 msec.
}
cnt++;
}
}
#############################################################
There are many breaking news telop player shown on TV and it seems much
better than my telop player.
I don't know how could I improve it much clear.
Please provide me your good ideas and I'll be looking forward to receiving
your reply.
Thank you for your time.
Erin Hsiao
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users