blob: 5eb468a1d84b00c3d198ce1d99c3b828f778de56 [file] [log] [blame]
Jonas Häggqvistb632ed12010-01-30 02:04:47 +00001<?php
Solomon Peachya0eef362020-04-02 10:05:23 -04002/************************************************************************
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äggqvistb632ed12010-01-30 02:04:47 +000021 $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?>