[GD] Klokje
Auteur: MEGAMIND - 06 januari 2005 - 15:20 - Gekeurd door: Dennisvb - Hits: 7504 - Aantal punten: 1.88 (4 stemmen)
Deze komt van phpfreakz
Voorbeeld
momenteel offline
|
Code: |
<?
//gemaakt door MEGAMIND
$size=100;
//
$size2=floor($size/2);
$img = imageCreate($size,$size);
$wit = imageColorAllocate($img, 255,255,255);
$zwart = imageColorAllocate($img, 0,0,0);
//ImageEllipse($img,$size/2,$size/2,$size,$size,$zwart);
//ImageEllipse($img,$size/2,$size/2,5,5,$wit);
for($min=0;$min<=60;$min++){
if ($min % 15 == 0)
$len = $size2 / 5;
elseif ($min % 5 == 0)
$len = $size2 / 10;
else
$len = $size2 / 25;
$ang = (2 * M_PI * $min) / 60;
$x1 = sin($ang) * ($size2 - $len) + $size2;
$y1 = cos($ang) * ($size2 - $len) + $size2;
$x2 = (1 + sin($ang)) * $size2;
$y2 = (1 + cos($ang)) * $size2;
ImageLine($img, $x1, $y1, $x2, $y2, $zwart);
}
list($hour, $min, $sec) = preg_split ("/-/", Date("h-i-s", Time()));
$hour = $hour % 12;
$xm = intval(cos($min * M_PI/30 - M_PI/2) * 0.65 * $size2 + $size2);
$ym = intval(sin($min * M_PI/30 - M_PI/2) * 0.65 * $size2 + $size2);
$xh = intval(cos($hour*5 * M_PI/30 - M_PI/2) * 0.5 * $size2 + $size2);
$yh = intval(sin($hour*5 * M_PI/30 - M_PI/2) * 0.5 * $size2 + $size2);
ImageLine($img, $size2, $size2-1, $xm, $ym, $zwart);
ImageLine($img, $size2-1, $size2, $xm, $ym, $zwart);
ImageLine($img, $size2, $size2-1, $xh, $yh, $zwart);
ImageLine($img, $size2-1, $size2, $xh, $yh, $zwart);
header("Content-Type: image/png");
imagePng($img);
imageDestroy($img);
?>
<? //gemaakt door MEGAMIND $size=100; // $img = imageCreate($size,$size); $wit = imageColorAllocate($img, 255,255,255); $zwart = imageColorAllocate($img, 0,0,0); //ImageEllipse($img,$size/2,$size/2,$size,$size,$zwart); //ImageEllipse($img,$size/2,$size/2,5,5,$wit); for($min=0;$min<=60;$min++){ if ($min % 15 == 0) $len = $size2 / 5; elseif ($min % 5 == 0) $len = $size2 / 10; else $len = $size2 / 25; $ang = (2 * M_PI * $min) / 60; $x1 = sin($ang) * ($size2 - $len) + $size2; $y1 = cos($ang) * ($size2 - $len) + $size2; $x2 = (1 + sin($ang)) * $size2; $y2 = (1 + cos($ang)) * $size2; ImageLine($img, $x1, $y1, $x2, $y2, $zwart); } $hour = $hour % 12; $xm = intval(cos($min * M_PI /30 - M_PI /2) * 0.65 * $size2 + $size2); $ym = intval(sin($min * M_PI /30 - M_PI /2) * 0.65 * $size2 + $size2); $xh = intval(cos($hour*5 * M_PI /30 - M_PI /2) * 0.5 * $size2 + $size2); $yh = intval(sin($hour*5 * M_PI /30 - M_PI /2) * 0.5 * $size2 + $size2); ImageLine($img, $size2, $size2-1, $xm, $ym, $zwart); ImageLine($img, $size2-1, $size2, $xm, $ym, $zwart); ImageLine($img, $size2, $size2-1, $xh, $yh, $zwart); ImageLine($img, $size2-1, $size2, $xh, $yh, $zwart); header("Content-Type: image/png"); imagePng($img); imageDestroy($img); ?>
Download code (.txt)
|
|
|
Stemmen |
Niet ingelogd. |
|