Icon Change

Started on the old forum in August 2006 · view the original in the archive · old links redirect here

4 replies · 903 views · started 20 years ago · 1 min read

2 participants
subzero Super moderator Fellow · 3,954 posts #1
<?php

// create image
$image = imagecreate(500, 350);

// sky backgrounds for random selection
$sky = array("terrain_sky_01.jpg","terrain_sky_02.jpg","terrain_sky_03.jpg");
$random_sky = $sky[rand(0,count($sky)-1)]; // selects a random sky from available ones

// terrain tiles for random selection
$background = array("terrain_tile_01.jpg","terrain_tile_02.jpg","terrain_tile_03.jpg","terrain_tile_04.jpg");
$random_background = $background[rand(0,count($background)-1)]; // selects a random tile from available ones

// define image and colors
$terrain = imagecreatefromjpeg("$random_sky");
imageantialias($terrain,TRUE);
$tile = imagecreatefromjpeg("$random_background");
$bg  = imagecolorallocate($terrain, rand(150,255), rand(150,255),rand(150,255));
$fill = imagesettile($terrain,$tile);

// draw a polygon
$points[0] = 0;
$points[1] = 350;
for ($x = 1; $x <= 27; $x++){
   $points[$x*2] = round(500/25*($x-1));
   $points[$x*2+1] = rand(200, 250);
}
$points[count($points)-1] = 350;
$points[count($points)] = 500;
for ($x=1;$x<=29;$x++){
   $bg_points[($x-1)*2] = $points[($x-1)*2];
   $bg_points[($x-1)*2+1] = $points[($x-1)*2+1]-3;
}
imagefilledpolygon($terrain, $bg_points, sizeof($points)/2, $bg);
imagefilledpolygon($terrain, $points, sizeof($points)/2, IMG_COLOR_TILED);

// flush image
header('Content-type: image/png');
imagepng($terrain);
imagedestroy($terrain);

?>

you end up with External image (may be gone)

now refleash your screen lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

naveen-PHP LEARNER #2

hmm...good coding...i like your coding style...:-)

Subzgal #3

/tease.gif" style="vertical-align:middle" emoid="8P" border="0" alt="tease.gif" />t;line-height:100%">Wirelessly posted (Nokia6630/1.0 (4.03.40) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1)

My bf a good coder he the king lol

subzero Super moderator Fellow · 3,954 posts #5

lol thanks just out to enjoy it lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close