Accueil > > > 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
Description
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);
?>
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
Sources de la même categorie
Commentaires et avis
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à dans une partie d'un programme que je fais, un visiteur cré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éer une image dynamique et je la renvoie au client via une balise <img scr=<?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 :<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html xmln
Création d'image [ par mightteam ]
Bonjour, j'aimerais généré une banniè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éer un album photo en PHP/MySQL. Mais j'ai un petit problème, je n'arrive pas à cré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
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|