Dear bretheren, I'm am asking you help because I have this #$!%&** client (oops, need to do more prayers now) who does not like the gauges Tk::Gauge provides. He is able to use printscreen and photoshop and he found some very flashy dials and he is making me do all that I can to use these awful things. My question is. If I save this dial to like a png or gif, how can I use the Tk::Gauge gauge to be placed over it and be transparent so that the needle moves while the picture underneath shows. Or should I use some other module. Canvas? Or gd with tk, or what?
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Gauge; #use Tk::Canvas; use utf8; my $mw = MainWindow->new; $mw->geometry("600x400"); $mw->configure( -background=>'black' ); $mw->title("map voltmeter"); $mw->optionAdd("*font", "*utf-8"); my $Vdc; $Vdc = 125; my $voltmeter = $mw->Gauge( -highlightbackground => 'black', -highlightcolor => 'black', -highlightthickness => 0, -background => 'black', -start => -180, -extent => -180, -style => 'arc',#'pieslice', -margin => '35', -outlinewidth => 3, -outline => '#10f0f0', -from => 90, -to => 150, -huboutline => '#10f0f0', -hubcolor => '#688898', -hubradius => 7, -hubplace => 'overneedle', -majortickcolor => '#10f0f0', -majortickthickness => 3, -majortickinterval => 10, -minortickinterval => '2', -minortickthickness => 3, -minortickcolor => '#10f0f0', -majorticklabelscale => 10.0 / 100.0, #12.0 / 60.0, -bands => [ { -tag=>'fatred', -arccolor => 'orangered2', -minimum => 140 +, -maximum => 150, -bandwidth => 9, }, ], -bandwidth => 9, -needles => [ { -arrowshape => [ 6, 6, 0 ], -color => 'orangered2', -command => undef, -command => undef, -format => '%d', #-radius => 206, -tag => '', #-titlecolor => 'blue', #-titlefont => 'Helvetica-42', -radius => 190, -variable => \$Vdc, -showvalue => 0, -width => 3, }, ] , -needlepad => 25, )->place(-x => 50, -y => 50); my $Vdc_lcd; #my $label_text = "&#1052;&#1040;&#1055; SIN\n&#1069;&#1053;&#1045;&#1 +056;&#1045;&#1056;&#1043;&#1048;&#1071;"; $mw->Label(-text => '&#1052;&#1040;&#1055; SIN', -font => [-family => 'nimbus sans l', -size => '12', -weight => 'b +old'], -foreground=> '#688898', -background => 'black', )->place( -x => 263, -y => 210 ); $mw->Label( -text => '&#1069;&#1085;&#1077;&#1088;&#1075;&#1080;&#1103;', -font => [-family => 'nimbus sans l', -size => '11', -weight => 'b +old'], -foreground=> '#688898', -background => 'black', )->place( -x => 266, -y => 245 ); $mw->Label( -textvariable => \$Vdc_lcd, -font => ['Helvetica','20'], -foreground=> '#10f0f0', -background => 'black')->place(-x => 5, -y => 5); #$mw -> repeat(500, sub{&movement}); $mw -> repeat(500, sub{&movement}); MainLoop; sub movement { my $range = 10; my $random_number = int(rand($range)); if ($random_number >= 5){ $Vdc++; } else { $Vdc--; } $Vdc = 125 if ($Vdc >=150 || $Vdc <=1); #for gauge purposes $Vdc_lcd = $Vdc/10; $Vdc_lcd = sprintf("%2.1f", $Vdc_lcd); $Vdc_lcd = $Vdc_lcd.' B'; }

In reply to client wants a pretty gauge from Tk::Gauge by pashanoid

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.