Location: PHPKode > scripts > GIF images into animated GIF with native PHP class > gif-images-into-animated-gif-with-native-php-class/example.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<div style="text-align: center;"><big style="font-family: Arial;"><big><span
 style="font-weight: bold;">GifMerge.class.php<br>
</span></big></big><img style="width: 198px; height: 114px;" alt=""
 src="example.gif">
<div style="text-align: left;">
<div style="text-align: left;"><big><small><span
 style="font-family: Arial;"></span></small></big><br>
<big><small><span
 style="font-weight: bold; text-decoration: underline; font-family: Arial;"></span></small></big></div>
<big><small><span
 style="font-weight: bold; text-decoration: underline; font-family: Arial;"><br>
</span></small></big><span
 style="font-family: Arial; text-decoration: underline;">Short support
for GifMerge.class.php.</span><br>
<br>
<span style="font-family: Arial;">Package contents:<br>
- GifMerge.class.php - GifMerge main class<br>
- View.php - example file<br>
- Example.html - Short support for GifMerge.class.php</span><br>
<big><small><span
 style="font-weight: bold; text-decoration: underline; font-family: Arial;"></span><span
 style="font-family: Arial;"></span><br style="font-family: Arial;">
<span style="font-weight: bold; text-decoration: underline;"><span
 style="font-family: Arial;">Class Construcor:</span><br>
</span><br>
</small></big><font size="+1"><span style="font-family: Arial;">$anim
= new GifMerge(</span><span
 style="font-family: Arial; color: rgb(204, 0, 0);">array images, int
transparent color red, </span></font><font
 style="color: rgb(204, 0, 0);" size="+1"><span
 style="font-family: Arial;">int transparent color green, </span></font><font
 style="color: rgb(204, 0, 0);" size="+1"><span
 style="font-family: Arial;">int transparent color blue, int loop,
array delay, array X offset, array X offset, string model type,
optional boolean debugger switch</span></font><font size="+1"><span
 style="font-family: Arial;">);</span></font><big><small><br>
<br>
<big><span style="font-family: Arial;"><span
 style="text-decoration: underline;">array images</span>:<br>
<big><font size="-1"><big><span style="font-family: Arial;">This array
type parameter can be used to pass the source frames.</span><br
 style="font-family: Arial;">
<span style="font-family: Arial;">The types of source frames have two
datatypes such as:</span><br style="font-family: Arial;">
<span style="font-family: Arial;">&nbsp;-Filename with full path e.g.:
'images/frame01.gif'.</span><br style="font-family: Arial;">
<span style="font-family: Arial;">&nbsp;-Direct binary data wich
created by imageGif() and ob_get_contents() functions.</span></big></font></big></span></big></small><font
 size="-1"><big><span style="font-family: Arial;"><br>
<br>
<span style="font-weight: bold; text-decoration: underline;">int
transparent red, </span></span></big></font></big><big
 style="font-weight: bold; text-decoration: underline;"><font size="-1"><big><span
 style="font-family: Arial;">int transparent green, </span></big></font></big><big><font
 size="-1"><big><span style="font-family: Arial;"><span
 style="font-weight: bold; text-decoration: underline;">int transparent
blue</span>:<br>
These three parameters can be used to pass the transparent pixel color
by red, green and blue components.<br>
If the background color of first frame has been definied as transparent
color<br>
this color will be reserved in the global color table,&nbsp; this color
will<br>
be constant and the pixel color of next frames will be definied as
transparent color at this entry in the global color table.<br>
If your image have not&nbsp; transparent color then set rgb integers
into -1, -1, -1<br>
<span style="color: rgb(51, 51, 255);">Tip:</span><br
 style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">Before merging change the frames
background color to transparent or not transparent </span><span
 style="color: rgb(51, 51, 255);">by dinamicaly.<br>
<br>
<span
 style="color: rgb(0, 0, 0); font-weight: bold; text-decoration: underline;">int
loop</span><span
 style="color: rgb(0, 0, 0); text-decoration: underline;"></span><span
 style="color: rgb(0, 0, 0);">:<br>
With this parameter can be used to set the loop of frames in the
animated GIF image.<br>
If the value of this parameter is 0 then loop of frames will be
infinity, if 1 then loop of frames will be one,<br>
if 2 then loop of frames will be two, etc...<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">array delay</span>:<br>
With this array type parameter can be used to pass delay time between
loop of frames as milliseconds.<br>
1000 milliseconds = 1 second<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">array X
offset, array Y offset</span>:<br>
With these parameters can be used to set the X-Y offset of frames.<br>
These parameters can be used if the first frame is a full image and<br>
the more frames are a part of first frame.<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">string
model type</span>:<br>
With this parameter can be used to set the type of source images.<br>
If the source images are saved GIF files and use the full path to images<br>
then set this parameter into 'C_FILE'.<br>
If the source images are generated binary stream by dinamicaly<br>
then set this parameter into 'C_MEMORY'.<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">optional
boolean debugger switch</span>:<br>
You can review the information of the frames and gifmerge process by
set of this parameter into true.<br>
If you use this parameter then you cannot use the <span
 style="color: rgb(51, 102, 255);">getAnimation()</span> retrieve
function.<br>
For this parameter set the http header into 'text/html'.<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">Image
retrieve</span>:<br>
<span style="font-weight: bold;">echo $anim-&gt;getAnimation();<br>
</span>This function will be set the http header into 'image/gif'<span
 style="font-weight: bold;"> </span>by automaticaly and return<br>
the generated animated GIF image.<br>
<span style="font-weight: bold;"></span></span></span></span></big></font></big><span
 style="font-family: Arial;"><span
 style="font-weight: bold; color: rgb(102, 0, 0);"></span></span><span
 style="font-family: Arial;"><span
 style="font-weight: bold; color: rgb(102, 0, 0);"><span
 style="color: rgb(0, 0, 0);"></span></span></span><span
 style="font-family: Arial;"></span><span style="font-family: Arial;"><span
 style="color: rgb(51, 204, 0);"><br>
</span></span>
<div style="text-align: center;"><span style="font-family: Arial;"><a
 href="http://www.gifs.hu">GifMerge.class.php by http://gifs.hu</a><span
 style="color: rgb(51, 204, 0);"></span></span><br>
<span style="font-family: Arial;"><span style="color: rgb(51, 204, 0);"></span></span><span
 style="font-family: Arial;"></span></div>
</div>
</div>
</body>
</html>
Return current item: GIF images into animated GIF with native PHP class