pense-bête de bruno sanchiz

Accueil > Programmation > PHP > gif animés

gif animés

Publié le 2 mars 2006, dernière mise-à-jour le 26 août 2019, 6 visites, 23646 visites totales.

(2006)
site d’origine

 utilisation de la classe : gifmerge

exemple

morceaux principaux :

<head>
<?php
require('GifMerge.class.php');
?>
</head>



$i = array("pt_anniv_jc_003.gif","pt_anniv_jc_004.gif");
$d = array(100, 50); //1000ms,500ms
$x = array(0, 0);
$y = array(0, 0);
$anim = new GifMerge($i, 255, 255, 255, 0, $d, $x, $y, 'C_FILE'); // images,tR,tV,tB,loop,délai,x,y,?)

$anim->getAnimation(); // le fichier gif

exemple sur la transparence

code transparence :

tR,tV,tB = 255, 255, 255 ( transparence totale sur le blanc )

tR,tV,tB = 0 ,0 , 0 ( pas de transparence )

- déplacement

- zoom

code de l’exemple :

<html>
<head>
<?php
require('GifMerge.class.php');
?>
</head>
<?php

$i = array("pt_anniv_jc_003.gif","pt_anniv_jc_004.gif");
$d = array(100, 50); //1000ms,500ms
$x = array(0, 0);
$y = array(0, 0);
$anim = new GifMerge($i, 255, 255, 255, 0, $d, $x, $y, 'C_FILE');

//echo $anim->getAnimation();
$savefile="anniv.gif";

$session = fopen ($savefile, "w");
fputs($session,$anim->getAnimation());
fclose ($session);
?>

<body>
<table>
<tr>
<td>
<img src="pt_anniv_jc_003.gif">
</td>

<td>
<img src="pt_anniv_jc_004.gif">
</td>
</tr>
<tr>
<td>
<img src="anniv.gif">
</td>
</tr>
</table>
</body></html> 
[bruno sanchiz]