hi! i've been experimenting around with the operators and i think i found something that is I think is in the right direction. I have 3 items on the goo canvas.
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');
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!

In reply to Re: goo canvas image mask by Anonymous Monk
in thread goo canvas image mask by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.