13 my $img = GD::Image->new('stemp-bg5.png');
16 my $dbh = nms::db_connect();
18 my $black = $img->colorAllocate(0,0,0);
19 my $white = $img->colorAllocate(255,255,255);
20 my $green = $img->colorAllocate(0,255,0);
21 my $blue = $img->colorAllocate(0,0,255);
27 my $color = &getcolor($avrgtemp);
29 for (my $i = $mintemp; $i <= $maxtemp; $i++) {
30 $img->line(600, 220 + $i - $mintemp, 645, 220 + $i - $mintemp, &getcolor($i));
33 $img->string(gdMediumBoldFont, 600, 200, "Freezing!$mintemp", $black);
34 $img->string(gdMediumBoldFont, 600, 210, "$mintemp C", $black);
35 $img->string(gdMediumBoldFont, 600, 220 + $maxtemp, "Too hot! $maxtemp", $black);
36 $img->string(gdMediumBoldFont, 600, 210 + $maxtemp, "$maxtemp C", $black);
41 #$img->stringUp(gdGiantFont,$px,$py - 2,"$avrgtemp",$white);
42 $img->filledRectangle($px - 0, $py - 17, $px + 12, $py + 5, $white);
43 $img->stringUp(gdLargeFont,$px - 4,$py - 1,"$avrgtemp",$blue);
44 $img->rectangle($px, $py, $px + 7,$py + 7,$black);
45 $img->filledRectangle($px + 1, $py + 1, $px + 6, $py + 6,$color);
47 print $cgi->header(-type=>'image/png');
53 my $percent = ($temp - $mintemp) / ($maxtemp - $mintemp);
54 my $colorred = 255 * $percent;
55 my $colorblue = 255 - $colorred;
57 return $img->colorAllocate($colorred, $colorblue, 0);