this codes gave me a black screen and part of girl15.jpg shows on the "black" area of the mask. which i think means that the masking works... but the only problem is that the "dest" has a color of black (according to cairo the default source color of a cairo context is black). so i thought that if i made the dest color transparent, maybe i will end up with girl16.jpg with a masked girl15.jpg on top. Problem is that i cant find a way to change the default color!my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("girl16.jpg"); my $i1 = Goo::Canvas::Image->new($canvas->{'item_layer'},$pixbuf,- +$pixbuf->get_width/2,-$pixbuf->get_height/2); $i1->set('operator'=>'over'); $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("girl15.jpg"); my $i2 = Goo::Canvas::Image->new($canvas->{'item_layer'},$pixbuf,- +$pixbuf->get_width/2,-$pixbuf->get_height/2); $i2->set('operator'=>'over'); $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("mask.png"); my $i3 = Goo::Canvas::Image->new($canvas->{'item_layer'},$pixbuf,- +$pixbuf->get_width/2,-$pixbuf->get_height/2); $i3->set('operator'=>'dest_atop');
In reply to Re: goo canvas image mask
by Anonymous Monk
in thread goo canvas image mask
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |