Bonjour,
jai recupere ce script afin d'avoir un thermometre.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 <?php function thermGraph( $current, $goal, $width, $height, $font ) { $bar = 0.75; // create the image $image = ImageCreate($width, $height); $bg = ImageColorAllocate($image,255,255,255 ); $fg = ImageColorAllocate($image,255,0,0); $tx = ImageColorAllocate($image,0,0,0); // Build background ImageFilledRectangle($image,0,0,$width,$height,$bg); // Build bottom bulb imagearc($image, $width/2, $height-($width/2), $width, $width, 0, 360, $fg); ImageFillToBorder($image, $width/2, $height-($width/2), $fg, $fg); // Build "Bottom level ImageFilledRectangle($image, ($width/2)-(($width/2)*$bar), $height-$width, ($width/2)+(($width/2)*$bar), $height-($width/2), $fg ); // Draw Top Border ImageRectangle( $image, ($width/2)-(($width/2)*$bar), 0, ($width/2)+(($width/2)*$bar), $height-$width, $fg); // Fill to % ImageFilledRectangle( $image, ($width/2)-(($width/2)*$bar), ($height-$width) * (1-($current/$goal)), ($width/2)+(($width/2)*$bar), $height-$width, $fg ); // Add tic's for( $k=25; $k<100; $k+=25 ) { ImageFilledRectangle( $image, ($width/2)+(($width/2)*$bar) -5, ($height-$width) - ($height-$width)*($k/100) -1, ($width/2)+(($width/2)*$bar) -1, ($height-$width) - ($height-$width)*($k/100) +1, $tx ); ImageString($image, $font, ($width/2)+(($width/2)*$bar) +2, (($height-$width) - ($height-$width)*($k/100)) - (ImageFontHeight($font)/2), sprintf( "%2d", $k), $tx); } // Add % over BULB $pct = sprintf( "%d%%", ($current/$goal)*100 ); ImageString( $image, $font+2, ($width/2)-((strlen($pct)/2)*ImageFontWidth($font+2)), ($height-($width/2))-(ImageFontHeight($font+2) / 2), $pct, $bg); // send the image header("content-type: image/png"); imagepng($image); } thermGraph( $HTTP_GET_VARS["Current"], $HTTP_GET_VARS["Goal"], $HTTP_GET_VARS["Width"], $HTTP_GET_VARS["Height"], $HTTP_GET_VARS["Font"] ); ?>
gd est bien activé sur mon serveur, et avec jpgraph.
J'arrive pas a trouvé le probleme.
Merci.
j'ai les message d'erreur :
Merci.Warning: imagecreate() [function.imagecreate]: Invalid image dimensions in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 26
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 27
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 28
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 29
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 32
Warning: imagearc(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 35
Warning: imagefilltoborder(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 36
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 39
Warning: imagerectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 42
Warning: Division by zero in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 45
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 45
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 50
Warning: imagestring(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 53
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 50
Warning: imagestring(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 53
Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 50
Warning: imagestring(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 53
Warning: Division by zero in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 57
Warning: imagestring(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 59
Warning: Cannot modify header information - headers already sent by (output started at L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php:59) in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 63
Warning: imagepng(): supplied argument is not a valid Image resource in L:\Program files 2\wamp\www\maison\N4\habitation\Web-thermographes\thermometer3.php on line 65
Partager