Skip navigation.
Home
The QNX Community Portal

View topic - PtRegion with Alpha Channel

PtRegion with Alpha Channel

Isn't the name clear?

PtRegion with Alpha Channel

Postby copperleaf » Mon Feb 18, 2008 2:06 pm

I want to create a region in a small app that covers the entire screen but shows whatever is behind at 50% opacity. I'm able to go full screen, but when I try and do a fill with PgARGB(128, 0, 0, 0) it is still 100% opaque. Here is the code I'm playing with:
Code: Select all
     if((p = getenv("PHIG")))
        input_group = atoi(p);
 
     PhQueryRids(0, 0, input_group, Ph_INPUTGROUP_REGION, 0, 0, 0, &rid, 1);
     PhRegionQuery(rid, &region, &rect, NULL, 0);
     PhWindowQueryVisible(Ph_QUERY_INPUT_GROUP | Ph_QUERY_EXACT, 0, region.input_group, &rect);
     PhRectToArea(&rect, &area);

     raw_cb.event_f = clickCB;
     raw_cb.event_mask = input_events;
     raw_cb.data = 0;

    PgSetColorModel(Pg_CM_ARGB);

    PtSetArg( &args[n++], Pt_ARG_AREA, &area, 0 );
    PtSetArg( &args[n++], Pt_ARG_REGION_SENSE, -1, input_events);
    PtSetArg( &args[n++], Pt_ARG_REGION_OPAQUE, -1, Ph_EV_PTR_ALL | Ph_EV_EXPOSE | Ph_EV_DRAW);
    PtSetArg( &args[n++], Pt_ARG_FILL_COLOR, PgARGB(128,0,0,0), 0 );
    PtSetArg( &args[n++], Pt_ARG_REGION_FIELDS, -1, Ph_REGION_ORIGIN
            | Ph_REGION_RECT | Ph_REGION_EV_SENSE | Ph_REGION_EV_OPAQUE
            | Ph_REGION_PARENT | Ph_REGION_FLAGS );
    PtSetArg( &args[n++], Pt_ARG_REGION_FLAGS, -1, Ph_FORCE_FRONT );
    PtSetArg( &args[n++], Pt_ARG_REGION_PARENT, 0, 0 );
     PtSetArg(&args[n++], Pt_ARG_REGION_INPUT_GROUP, region.input_group, 0);
     PtSetArg(&args[n++], Pt_ARG_REGION_INFRONT, Ph_DEV_RID, 0);
    PtSetParentWidget( NULL );               
    frame = PtCreateWidget( PtRegion, NULL, n, args );
 


I've event tried painting the region with PgTRANSPARENT and drawing a label with 50% fill, but has the same result.

Is there any way to do this?

TIA,
Bill
copperleaf
New Member
 
Posts: 9
Joined: Thu Jan 13, 2005 1:29 pm
Location: Richmond, VA

RE: PtRegion with Alpha Channel

Postby ysinitsky » Mon Apr 07, 2008 6:28 pm

“I want to create a region in a small app that covers the entire screen but shows whatever is behind at 50% opacityâ€
ysinitsky
Senior Member
 
Posts: 164
Joined: Wed Dec 14, 2005 8:46 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 3 guests