On 6/1/07, catch <[EMAIL PROTECTED]> wrote:
Hi, I want to blit an ARGB subsurface to primary surface, And the result I want is just copy the subsurface to primary surface, both color and alpha values. For example, the ARGB of primary is ( a, r, g, b ), and that of sub is ( a2, r2, g2, b2 ) After primary->blit( primary, sub ), the ARGB of primary will change to ( a2, r2, g2 ,b2 ) But I can 't achieve this result, there may be something wrong with the flags Here is my code: primary->SetPorterDuff( primary, DSPD_SRC ); primary->SetBlittingFlags( primary, DSBLIT_BLEND_ALPHACHANNEL );
I changed the flags here to primary->SetBlittingFlags( primary, DSBLIT_BLEND_COLORALPHA ); primary->SetDrawingFlags( primary, DSDRAW_BLEND );
primary->SetColor( primary, 0, 0, 255, 128 ); primary->FillRectangle( primary, 0, 0, width, height ); primary->Flip( primary, NULL, DSFLIP_WAITFORSYNC ); sub ->SetBlittingFlags(sub, DSBLIT_BLEND_ALPHACHANNEL ); sub->SetDrawingFlags( sub, DSDRAW_BLEND ); sub->SetColor(sub, 0, 0, 255, 128 ); sub->FillRectangle( sub, 0, 0, width, height ); sub->SetColor(sub, 255, 255, 255, 255 ); sub->DrawString(sub, buf, -1, 0, 0, DSTF_LEFT | DSTF_TOP ); sub->Flip( sub, NULL, DSFLIP_WAITFORSYNC ); primary->Blit( primary, sub, NULL, 0, 0 );
the background(rectangle) alpha will be set to the correct value, but the text color value is not correct it seems becoming to ( 255, 255, 255, 128 ) or ( 128, 128, 128, 255 )??
_______________________________________________ directfb-users mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
