begin process at 2012 05 27 21:36:08
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Graphique

 > GÉNÉRATION ALÈATOIRE D'UNE IMAGE POUVANT SERVIR DE FOND D'ÉCRAN.

GÉNÉRATION ALÈATOIRE D'UNE IMAGE POUVANT SERVIR DE FOND D'ÉCRAN.


 Information sur la source

Note :
Aucune note
Catégorie :Graphique Classé sous :générateur, création, automatique, image, aléatoire Niveau :Initié Date de création :04/03/2007 Date de mise à jour :05/03/2007 17:51:58 Vu / téléchargé :8 013 / 273

Auteur : c v

Ecrire un message privé
Site perso
Commentaire sur cette source (13)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Exemple de l'image qui va aléatoirement être crée http://generator.zeubu.com/?id=generator_image_fon d_ecran

C'est une image donc il faut afficher la page php comme une image en html :
<img src='http://generator.zeubu.com/generator_image/fo nd_ecran/art_etoile.php' border='0'>

L'image est crée à chaque affichage, mais elle peut être concervée dans le cache du navigateur donc pour éviter ça :
echo "<img src='http://generator.zeubu.com/generator_image/fo nd_ecran/art_etoile.php?".rand(0,99999)."' border='0'>";

Si on veut un fond transparent : art_etoile.php?transp
Si on veut un fond noir : art_etoile.php?noir
Si on veut un fond noir et flou : art_etoile.php?noir&flou
Si on veut un fond noir et trés flou : art_etoile.php?noir&flouplus
Si on veut un fond transparent et net : art_etoile.php?transp&net

Si les paramètres noir/transp et net/flou ne sont pas précisés, ils seront choisi au hasard (sauf flouplus).

Source

  • <?php
  • //
  • //*****************************************************************************
  • //* ______ _____ _ _ _____ _ _ _____ _____ ___ ___*
  • //* |___ / | ____| | | | | | _ \ | | | | / ___| / _ \ / |/ | HTTP://WWW.GENERATOR.ZEUBU.COM
  • //* / / | |__ | | | | | |_| | | | | | | | | | | | / /| /| |
  • //* / / | __| | | | | | _ { | | | | | | | | | | / / |__/ | |
  • //* / /__ | |___ | |_| | | |_| | | |_| | _ | |___ | |_| | / / | |
  • //* /_____| |_____| \_____/ |_____/ \_____/ |_| \_____| \_____/ /_/ |_| CREATED BY CLEMENT VIALETTES
  • //* *
  • //*****************************************************************************
  • //
  • Header('Content-type: image/png');
  • $img = ImageCreate( 200, 200);
  • $colorbackgr = ImageColorAllocate( $img, 0, 0, 0);
  • //nombre de cercles
  • $u1 = Rand( 10, 20);
  • for( $i=1; $i < $u1; $i++)
  • {
  • //couleurs
  • $col1 = Rand( 71, 255);
  • $col2 = Rand( 71, 255);
  • $col3 = Rand( 71, 255);
  • //position des centres x y
  • $a1 = Rand( -5, 105);
  • $a2 = Rand( -5, 105);
  • //largeur et hauteur x y
  • $a3 = Rand( 5, 150);
  • $a4 = Rand( 5, 150);
  • //début du cercle et fin
  • $deg1 = Rand( 0, 360);
  • $deg2 = Rand( 0, 360);
  • //type de cercle
  • $a5 = Rand( 0, 1);
  • if($a5 == 0)
  • {
  • ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img, $col1, $col2, $col3));
  • ImageArc( $img, $a1+1, $a2+1, $a3+1, $a4+1, $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
  • ImageArc( $img, $a1-1, $a2-2, $a3-1, $a4-1, $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
  • ImageArc( $img, $a1+2, $a2+2, $a3+2, $a4+2, $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
  • ImageArc( $img, $a1-2, $a2-2, $a3-2, $a4-2, $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
  • ImageArc( $img, $a1+3, $a2+3, $a3+3, $a4+3, $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
  • ImageArc( $img, $a1-3, $a2-3, $a3-3, $a4-3, $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
  • ImageArc( $img, $a1+4, $a2+4, $a3+4, $a4+4, $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
  • ImageArc( $img, $a1-4, $a2-4, $a3-4, $a4-4, $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
  • ImageArc( $img, $a1+5, $a2+5, $a3+5, $a4+5, $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
  • ImageArc( $img, $a1-5, $a2-5, $a3-5, $a4-5, $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
  • ImageArc( $img, $a1+6, $a2+6, $a3+6, $a4+6, $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
  • ImageArc( $img, $a1-6, $a2-6, $a3-6, $a4-6, $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
  • ImageArc( $img, $a1+7, $a2+7, $a3+7, $a4+7, $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
  • ImageArc( $img, $a1-7, $a2-7, $a3-7, $a4-7, $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
  • }
  • else
  • {
  • ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img, $col1, $col2, $col3));
  • ImageArc( $img, $a1+1*Rand(-1,1), $a2+1*Rand(-1,1), $a3+1*Rand(-1,1), $a4+1*Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
  • ImageArc( $img, $a1-1*Rand(-1,1), $a2-2*Rand(-1,1), $a3-1*Rand(-1,1), $a4-1*Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
  • ImageArc( $img, $a1+2*Rand(-1,1), $a2+2*Rand(-1,1), $a3+2*Rand(-1,1), $a4+2*Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
  • ImageArc( $img, $a1-2*Rand(-1,1), $a2-2*Rand(-1,1), $a3-2*Rand(-1,1), $a4-2*Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
  • ImageArc( $img, $a1+3*Rand(-1,1), $a2+3*Rand(-1,1), $a3+3*Rand(-1,1), $a4+3*Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
  • ImageArc( $img, $a1-3*Rand(-1,1), $a2-3*Rand(-1,1), $a3-3*Rand(-1,1), $a4-3*Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
  • ImageArc( $img, $a1+4*Rand(-1,1), $a2+4*Rand(-1,1), $a3+4*Rand(-1,1), $a4+4*Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
  • ImageArc( $img, $a1-4*Rand(-1,1), $a2-4*Rand(-1,1), $a3-4*Rand(-1,1), $a4-4*Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
  • ImageArc( $img, $a1+5*Rand(-1,1), $a2+5*Rand(-1,1), $a3+5*Rand(-1,1), $a4+5*Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
  • ImageArc( $img, $a1-5*Rand(-1,1), $a2-5*Rand(-1,1), $a3-5*Rand(-1,1), $a4-5*Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
  • ImageArc( $img, $a1+6*Rand(-1,1), $a2+6*Rand(-1,1), $a3+6*Rand(-1,1), $a4+6*Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
  • ImageArc( $img, $a1-6*Rand(-1,1), $a2-6*Rand(-1,1), $a3-6*Rand(-1,1), $a4-6*Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
  • ImageArc( $img, $a1+7*Rand(-1,1), $a2+7*Rand(-1,1), $a3+7*Rand(-1,1), $a4+7*Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
  • ImageArc( $img, $a1-7*Rand(-1,1), $a2-7*Rand(-1,1), $a3-7*Rand(-1,1), $a4-7*Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
  • }
  • }
  • //image 100x100 a été crée
  • //flou ?
  • if(isset($net)==1);
  • elseif(isset($flouplus)==1)
  • {
  • $img2 = ImageCreate( 200, 200);
  • Imagecopy($img2,$img,0,0,0,0,imagesx($img),imagesy($img));
  • Imagecopymerge($img,$img2,0,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,3,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,4,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,3,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,4,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,3,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,4,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,3,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,3,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,3,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,3,3,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,3,4,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,4,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,4,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,4,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,4,3,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,4,4,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,2,0,0,imagesx($img),imagesy($img),50);
  • ImageDestroy($img2);
  • }
  • elseif((isset($flou)==1)||(Rand(0,1) == 1))
  • {
  • $img2 = ImageCreate( 200, 200);
  • Imagecopy($img2,$img,0,0,0,0,imagesx($img),imagesy($img));
  • Imagecopymerge($img,$img2,0,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,0,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,0,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,1,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,2,2,0,0,imagesx($img),imagesy($img),50);
  • Imagecopymerge($img,$img2,1,1,0,0,imagesx($img),imagesy($img),50);
  • ImageDestroy($img2);
  • }
  • //symétrie
  • $x = 0; $y = 0;
  • while( $x <= 100)
  • {
  • for( $y=0; $y<=100; $y++)
  • {
  • //image de droite
  • ImageSetPixel( $img, 200-($x), $y, ImageColorAt( $img, $x ,$y));
  • //image dessous gauche
  • ImageSetPixel( $img, $x, 200-$y, ImageColorAt( $img, $x, $y));
  • //image dessous droite
  • ImageSetPixel( $img, 200-$x, 200-$y, ImageColorAt( $img, $x, $y));
  • }
  • $x++;
  • }
  • //transparent ?
  • if(isset($noir)==1);
  • elseif((isset($transp)==1)||( Rand(0,1) == 1))
  • ImageColorTransparent( $img, ImageColorClosest( $img, 0, 0, 0));
  • // On crée l'image
  • ImagePng($img);
  • // On libère l'espace mémoire alloué à l'image
  • ImageDestroy($img);
  • ?>
<?php
//
//*****************************************************************************
//*  ______  _____   _   _   _____   _   _        _____   _____       ___  ___*
//* |___  / | ____| | | | | |  _  \ | | | |      /  ___| /  _  \     /   |/   | HTTP://WWW.GENERATOR.ZEUBU.COM
//*    / /  | |__   | | | | | |_| | | | | |      | |     | | | |    / /|   /| |
//*   / /   |  __|  | | | | |  _  { | | | |      | |     | | | |   / / |__/ | |
//*  / /__  | |___  | |_| | | |_| | | |_| |  _   | |___  | |_| |  / /       | |
//* /_____| |_____| \_____/ |_____/ \_____/ |_|  \_____| \_____/ /_/        |_| CREATED BY CLEMENT VIALETTES
//*                                                                            *
//*****************************************************************************
//

Header('Content-type: image/png');

$img = ImageCreate( 200, 200);

$colorbackgr = ImageColorAllocate( $img, 0, 0, 0);

//nombre de cercles
$u1 = Rand( 10, 20);

for( $i=1; $i < $u1; $i++)
{
	//couleurs
	$col1 = Rand( 71, 255);
	$col2 = Rand( 71, 255);
	$col3 = Rand( 71, 255);

	//position des centres x y
	$a1 = Rand( -5, 105);
	$a2 = Rand( -5, 105);

	//largeur et hauteur x y
	$a3 = Rand( 5, 150);
	$a4 = Rand( 5, 150);

	//début du cercle et fin
	$deg1 = Rand( 0, 360);
	$deg2 = Rand( 0, 360);

	//type de cercle
	$a5 = Rand( 0, 1);
	
	if($a5 == 0)
	{
		ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img, $col1, $col2, $col3));
		ImageArc( $img, $a1+1, $a2+1, $a3+1, $a4+1, $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
		ImageArc( $img, $a1-1, $a2-2, $a3-1, $a4-1, $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
		ImageArc( $img, $a1+2, $a2+2, $a3+2, $a4+2, $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
		ImageArc( $img, $a1-2, $a2-2, $a3-2, $a4-2, $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
		ImageArc( $img, $a1+3, $a2+3, $a3+3, $a4+3, $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
		ImageArc( $img, $a1-3, $a2-3, $a3-3, $a4-3, $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
		ImageArc( $img, $a1+4, $a2+4, $a3+4, $a4+4, $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
		ImageArc( $img, $a1-4, $a2-4, $a3-4, $a4-4, $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
		ImageArc( $img, $a1+5, $a2+5, $a3+5, $a4+5, $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
		ImageArc( $img, $a1-5, $a2-5, $a3-5, $a4-5, $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
		ImageArc( $img, $a1+6, $a2+6, $a3+6, $a4+6, $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
		ImageArc( $img, $a1-6, $a2-6, $a3-6, $a4-6, $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
		ImageArc( $img, $a1+7, $a2+7, $a3+7, $a4+7, $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
		ImageArc( $img, $a1-7, $a2-7, $a3-7, $a4-7, $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
	}
	else
	{
		ImageArc( $img, $a1, $a2, $a3, $a4, $deg1, $deg2, ImageColorAllocate( $img, $col1, $col2, $col3));
		ImageArc( $img, $a1+1*Rand(-1,1), $a2+1*Rand(-1,1), $a3+1*Rand(-1,1), $a4+1*Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
		ImageArc( $img, $a1-1*Rand(-1,1), $a2-2*Rand(-1,1), $a3-1*Rand(-1,1), $a4-1*Rand(-1,1), $deg1+1, $deg2-1, ImageColorAllocate( $img, $col1-10, $col2-10, $col3-10));
		ImageArc( $img, $a1+2*Rand(-1,1), $a2+2*Rand(-1,1), $a3+2*Rand(-1,1), $a4+2*Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
		ImageArc( $img, $a1-2*Rand(-1,1), $a2-2*Rand(-1,1), $a3-2*Rand(-1,1), $a4-2*Rand(-1,1), $deg1+2, $deg2-2, ImageColorAllocate( $img, $col1-20, $col2-20, $col3-20));
		ImageArc( $img, $a1+3*Rand(-1,1), $a2+3*Rand(-1,1), $a3+3*Rand(-1,1), $a4+3*Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
		ImageArc( $img, $a1-3*Rand(-1,1), $a2-3*Rand(-1,1), $a3-3*Rand(-1,1), $a4-3*Rand(-1,1), $deg1+3, $deg2-3, ImageColorAllocate( $img, $col1-30, $col2-30, $col3-30));
		ImageArc( $img, $a1+4*Rand(-1,1), $a2+4*Rand(-1,1), $a3+4*Rand(-1,1), $a4+4*Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
		ImageArc( $img, $a1-4*Rand(-1,1), $a2-4*Rand(-1,1), $a3-4*Rand(-1,1), $a4-4*Rand(-1,1), $deg1+4, $deg2-4, ImageColorAllocate( $img, $col1-40, $col2-40, $col3-40));
		ImageArc( $img, $a1+5*Rand(-1,1), $a2+5*Rand(-1,1), $a3+5*Rand(-1,1), $a4+5*Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
		ImageArc( $img, $a1-5*Rand(-1,1), $a2-5*Rand(-1,1), $a3-5*Rand(-1,1), $a4-5*Rand(-1,1), $deg1+5, $deg2-5, ImageColorAllocate( $img, $col1-50, $col2-50, $col3-50));
		ImageArc( $img, $a1+6*Rand(-1,1), $a2+6*Rand(-1,1), $a3+6*Rand(-1,1), $a4+6*Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
		ImageArc( $img, $a1-6*Rand(-1,1), $a2-6*Rand(-1,1), $a3-6*Rand(-1,1), $a4-6*Rand(-1,1), $deg1+6, $deg2-6, ImageColorAllocate( $img, $col1-60, $col2-60, $col3-60));
		ImageArc( $img, $a1+7*Rand(-1,1), $a2+7*Rand(-1,1), $a3+7*Rand(-1,1), $a4+7*Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
		ImageArc( $img, $a1-7*Rand(-1,1), $a2-7*Rand(-1,1), $a3-7*Rand(-1,1), $a4-7*Rand(-1,1), $deg1+7, $deg2-7, ImageColorAllocate( $img, $col1-70, $col2-70, $col3-70));
	}
}

//image 100x100 a été crée

//flou ?

if(isset($net)==1);
elseif(isset($flouplus)==1)
{

	$img2 = ImageCreate( 200, 200);
	
	Imagecopy($img2,$img,0,0,0,0,imagesx($img),imagesy($img));

	Imagecopymerge($img,$img2,0,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,3,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,4,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,3,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,4,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,1,0,0,imagesx($img),imagesy($img),50);
	
	Imagecopymerge($img,$img2,2,3,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,4,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,3,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,3,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,3,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,3,3,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,3,4,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,4,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,4,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,4,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,4,3,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,4,4,0,0,imagesx($img),imagesy($img),50);
	
	Imagecopymerge($img,$img2,2,2,0,0,imagesx($img),imagesy($img),50);

	ImageDestroy($img2);
}
	
elseif((isset($flou)==1)||(Rand(0,1) == 1))
{

	$img2 = ImageCreate( 200, 200);
	
	Imagecopy($img2,$img,0,0,0,0,imagesx($img),imagesy($img));

	Imagecopymerge($img,$img2,0,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,0,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,0,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,1,2,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,1,0,0,imagesx($img),imagesy($img),50);
	Imagecopymerge($img,$img2,2,2,0,0,imagesx($img),imagesy($img),50);

	Imagecopymerge($img,$img2,1,1,0,0,imagesx($img),imagesy($img),50);

	ImageDestroy($img2);
}
	
//symétrie

$x = 0;		$y = 0;

while( $x <= 100)
{
	for( $y=0; $y<=100; $y++)
	{
		//image de droite
		ImageSetPixel( $img, 200-($x), $y, ImageColorAt( $img, $x ,$y));

		//image dessous gauche
		ImageSetPixel( $img, $x, 200-$y, ImageColorAt( $img, $x, $y));

		//image dessous droite
		ImageSetPixel( $img, 200-$x, 200-$y, ImageColorAt( $img, $x, $y));
	}
	$x++;
}

//transparent ?

if(isset($noir)==1);
elseif((isset($transp)==1)||( Rand(0,1) == 1))
	ImageColorTransparent( $img, ImageColorClosest( $img, 0, 0, 0));

// On crée l'image

ImagePng($img);

// On libère l'espace mémoire alloué à l'image

ImageDestroy($img);

?>


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Historique

04 mars 2007 13:34:12 :
Modification de l'exemple du zip
05 mars 2007 15:27:42 :
Ajout de l'option flou.
05 mars 2007 17:51:59 :
Ajout du très flou plus.

 Sources du même auteur

Source avec Zip Source avec une capture GÉNÉRATEUR DE TEXTE SUR IMAGE(S) (BANNIÈRES/BOUTTONS....OU N...

 Sources de la même categorie

Source avec Zip Source avec une capture CAMEMBERT BD par dardelphi
Source avec une capture AMÉLIORATION : CAMEMBERT par asphator
GESTION DE COULEUR par manuche
Source avec Zip NAVIGATOR (+CSSDETECTOR) par xXVoxPopuliXx
COMMENT, AVEC GD, DESSINER UN RECTANGLE TRANSPARENT PLEIN AV... par Rainbow

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture SANYBEE GALLERY par sakini
GÉNÉRATEUR HTML DE MAP POUR IMAGE CLIQUABLE par 8Tnerolf8
Source avec Zip Source avec une capture FUNCTION CAPTCHA par waterw72
Source avec Zip Source avec une capture GÉNÉRATEUR D'IMAGES GIF AFFICHANT UN CALENDRIER TYPE FEUILLE... par webrunner
REDIMENSIONNEMENT AUTOMATIQUE D'IMAGES par GanJasTeR

Commentaires et avis

Commentaire de c v le 04/03/2007 12:27:05

Merci phpcs.com je vais pouvoir récupérer mon code en version colorié :)

Commentaire de coockiesch le 04/03/2007 14:09:46

Salut!
Y'a highlight_string qui le fait aussi ;)

@++

R@f

Commentaire de coockiesch le 04/03/2007 14:11:17

Sinon, c'est inutile mais marrant et assez joli, :)

@++

R@f

Commentaire de c v le 04/03/2007 21:28:07

j'ai quand même récupéré les couleurs, j'y penserai la prochaine fois.
merci

Commentaire de manouille le 05/03/2007 09:41:49

Marche pas sous firefox ...

sinon c'est rigolo :)

Commentaire de Chamyky le 05/03/2007 12:07:46

Ca rend bien !
Je n'ai aucune compétence avec l'API de dessin de PHP, mais je serais d'avis de faire un smooth sur cette image, ça la rendrait tout de suite beaucoup plus attrayante !
Il me semblait avoir vu un code de lissage, sur PHPcs...

Commentaire de c v le 05/03/2007 15:33:50

J'ai ajouté l'option flou, j'ai oublié de dire que si on ne la veut pas il faut mettre art_etoile.php?net
Apparemment ma technique de création du flou (9 x copymerge) ralenti le calcul de l'image de manière visible.

Commentaire de Chamyky le 05/03/2007 15:53:47

Est-ce que tu l'as mise à jour sur ton site ? Je n'ai vu aucun changement...

Commentaire de coockiesch le 05/03/2007 16:07:55

Manouille: no pb pr moi sous FF, :)

@++

R@f

Commentaire de c v le 05/03/2007 17:45:59

Oui c'est à jour sur mon site et ça met le flou ou non au hasard,
sinon pour l'imposer afin de voir la différence :
http://generator.zeubu.com/generator_image/fond_ecran/art_etoile.php?net
http://generator.zeubu.com/generator_image/fond_ecran/art_etoile.php?flou

et puisque tu ne vois pas la différence :-)
http://generator.zeubu.com/generator_image/fond_ecran/art_etoile.php?flouplus

Je ne n'avais pas retenu le flou plus je le trouvais un peu ... flou, je vais le mettre ici.

Commentaire de Chamyky le 05/03/2007 17:53:49

D'accord, le flou "dédouble" l'image sur elle même... mais, ça rend moins bien en transparent.
Mais, c'est quand même très beau tout ça !

Commentaire de c v le 05/03/2007 18:38:31

Oui merci pour ton idée si tu en as d'autres je suis preneur.
C'est pas mal avec le flou des fois on dirait que ça donne un peu de relief, tien c'est une idée ça !

Commentaire de didoudu17 le 18/04/2008 20:55:34

salut
ok une remarque à laisser :
il faut bannir les count dans les boucles :

ne pas faire ==>
     for($j=0;$j<count($tri);$j++)
faire ==>
     for($j=0,$count=count($tri);$j<$count;$j++)

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Problème dans la création d'une image!!! [ par Elkaire ] Apres avoir definit les differents éléments nécéssaires à la création de mon image j'en viens à appeller la fonction header ("content-type:imge/png") création automatique table et champs [ par liege ] bonsoir,je cherche un code à insérer dans le fichier de récupération des données de mon formulaire pour qu'il crée automatiquement la table si elle n' tentative de création d'une image [ par Waldo2188 ] Salut a tousRevoila le NewBhé oui j'ai encore un problème.Bon la j'ai essaié de créer une image avec ImageCreatedmais quand je lance l'appli, l'explor Ajout d'une id aléatoire dans une url [ par baab ] Bonjour,Voil&#224; dans une partie d'un programme que je fais, un visiteur cr&#233;e une image et ensuite je lui fournis l'url de l'image que je modif Création d'une image avec imagepng [ par vincentstryckmans ] Bonjour, J'utilise imagepng($image,$filename) pour cr&#233;er une image dynamique et je la renvoie au client&nbsp; via une balise &lt;img scr=&lt;?ph Création automatique d'un topic. [ par Sl4d3 ] Bonjour, Pour mes besoins personnel j'ai du faire un script pour traduire des présentations au format bbcodes des forums. Mais j'aimerait dorénavant p création d'image si ... [ par nicomilville ] Bonjour !!!j'ai une page formulaire.php :&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;&lt;html xmln Création d'image [ par mightteam ] Bonjour,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j'aimerais&nbsp;g&#233;n&#233;r&#233; une banni&#232;re a partir d'un text sortant d'une base de don Création de miniature lors de l'upload d'une image [ par jizz666 ] Hello, Je suis actuellement entrain de cr&#233;er un album photo en PHP/MySQL. Mais j'ai un petit probl&#232;me, je n'arrive pas &#224; cr&#233;er l Création d'un tableau avec SQL ( je suis bloqué :( ) [ par alexlet ] Bonsoir à tous,Voila, je débute et je suis bloquer:Je veus afficher une requette mysql dans un tableau ( j'ai pas trouvé de sources pouvant m'aider su


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,718 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales