Tk itself, does not support transparency, but Tk::Zinc does. Another alternative is to move up to Gtk2 or Gtk3, which does handle transparency. For example see: Goo Canvas and transparent images
#!/usr/bin/perl use warnings; use strict; use Tk::Zinc; my $width = 100; my $height = 100; my $mw = MainWindow->new(-background => 'cyan'); $mw->geometry($width.'x'.$height.'+300+300'); $mw->overrideredirect(1); my $zinc = $mw->Zinc(-width => $width, -height => $height, -reshape => 1, #clips zinc -fullreshape => 1, #clips $mw and xterm -backcolor => 'cyan', )->pack; #make a flower my $petal = $zinc->add('curve',1,[[$width/2,$height], [0,0, 'c'], [$width,0, 'c'], [$width/2,$height]], -tags => ['bezier1'], -filled => 1, -fillcolor => 'cyan', -closed => 1, -linewidth => 0, -priority => 1, -visible => 0, ); # using the triangulaire curve to reshape both TkZinc and Mainwindow w +idgets $zinc->itemconfigure(1, -clip => $petal); my $petal1 = $zinc->add('curve',1,[[$width/2,$height], [-2*$width,-100 +, 'c'], [3*$width,-100, 'c'], [$width/2,$hei +ght]], -tags => ['bezier1'], -filled => 1, -fillcolor => 'cyan', -closed => 1, -linewidth => 0, -priority => 1, -visible => 1, ); &Tk::MainLoop;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Perl/Tk problems with PNG transparence by zentara
in thread Perl/Tk problems with PNG transparence by wmfs

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.