q962
(提及)
1
GtkSnapshot* child_snapshot = snapshot; // gtk_snapshot_new();
gtk_snapshot_push_opacity( child_snapshot, 0.4 );
gtk_widget_snapshot_child( widget, child, child_snapshot )
gtk_snapshot_pop( child_snapshot );
GtkSnapshot* child_snapshot = gtk_snapshot_new();
gtk_snapshot_push_opacity( child_snapshot, 0.4 );
gtk_widget_snapshot_child( widget, child, child_snapshot )
gtk_snapshot_pop( child_snapshot );
gtk_snapshot_append_node( snapshot, gtk_snapshot_free_to_node( child_snapshot ) );
what should I do?
q962
(提及)
2

I think the transparency has taken effect, but for some reason, the yellow one is not being lowered.
q962
(提及)
3
There is no problem with the above code, I found the problem. this confused me.
I just need to add the following code for the child control
gtk_snapshot_push_opacity( snapshot, 1.0 );
gtk_snapshot_append_color( snapshot, &color, &GRAPHENE_RECT_INIT( 0, 0, offset, height / 2 ) );
gtk_snapshot_pop(snapshot);
to get the transparency to work
system
(system)
Closed
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.