BlackHalt writeln (by me or from manual) PHP source Codes ...
BlackHalt PHP+GD+PNG gradient:
<?php
// PHP + GD + PNG pārejas
ob_start();
// bildes daļa
header('Content-type: image/png');
$platums=300;
$augstums=300;
$bilde=imagecreate($platums,$augstums);
$ramis=imagecolorallocate($bilde,150,150,150);
$baals=64;
for($i=0;$i<=255;$i++){
#$nejaush=rand(0,255);
#$krasa=imagecolorallocate($bilde,$nejaush,$nejaush,$nejaush);
#$krasa=imagecolorallocate($bilde,$nejaush-$i,$nejaush+$i,$nejaush-$i);
$krasa=imagecolorallocate($bilde,$i-$baals,$i-$baals,$i-$baals);
imagefilledrectangle($bilde,$i,$i,$platums-$i,$augstums-$i,$krasa);
}
imagerectangle($bilde,0,0,$platums-1,$augstums-1,$ramis);
imagepng($bilde);
#v1# imagedestroy($bilde);
//
// Bildes saglabāšana PNG failā:
$dabon=ob_get_contents();
$nosaukums=date('Y-m-d-H-i-s');
#v1# $fp=fopen("$nosaukums.png",'w+');
#v1# fwrite($fp,$dabon);
#v1# fclose($fp);
imagepng($bilde,"$nosaukums.png"); //v2
imagedestroy($bilde); //v2
ob_end_flush();
?>