Jonas Häggqvist | b632ed1 | 2010-01-30 02:04:47 +0000 | [diff] [blame] | 1 | <?php |
Solomon Peachy | a0eef36 | 2020-04-02 10:05:23 -0400 | [diff] [blame] | 2 | /************************************************************************ |
| 3 | * __________ __ ___. |
| 4 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 5 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 6 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 7 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 8 | * \/ \/ \/ \/ \/ |
| 9 | * Copyright (C) 2010 Jonas Häggqvist |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public License |
| 13 | * as published by the Free Software Foundation; either version 2 |
| 14 | * of the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 17 | * KIND, either express or implied. |
| 18 | * |
| 19 | **************************************************************************/ |
| 20 | |
Jonas Häggqvist | b632ed1 | 2010-01-30 02:04:47 +0000 | [diff] [blame] | 21 | $height = 15; |
| 22 | $width = 150; |
| 23 | $percent = $_REQUEST['p']; |
| 24 | $im = imagecreatetruecolor($width, $height); |
| 25 | $translated = imagecolorallocate($im, 0, 255, 0); |
| 26 | $missing = imagecolorallocate($im, 255, 0, 0); |
| 27 | imagefill($im, 0, 0, $missing); |
| 28 | imagefilledrectangle($im, 0, 0, $width * $percent / 100, $height, $translated); |
| 29 | header("Content-type: image/png"); |
| 30 | imagepng($im); |
| 31 | ?> |