PIM Team Case Study: Creating Text Effects With PHP and GD

Written by Bobby Handzhiev


PIM Team Case Study: Creating Text Effects With PHP and GD

See how you can create graphic effects on text with PHP and GD - drop shadows, arcs, fonts and colors.

Problem A-tec Signs and Sraphics Inc. launched a web site withrepparttar idea to sell decals online. To achieve better customers ineterestrepparttar 107614 website had to integrate online decal builder. The company is offering also decals for vehicles which brought some specific requirements torepparttar 107615 builder like havingrepparttar 107616 decal text turning arround 4 types of arcs.

Goals - Provide users with preview area - Allow visitors to choose font and color - Allow adding drop shadow and selecting drop shadow color - Allow turningrepparttar 107617 text into arcs - Real Time calculating Solution Because ofrepparttar 107618 need for increasing customers interest we had to think about not for perfect math formulas when showingrepparttar 107619 graphs inrepparttar 107620 preview area, but forrepparttar 107621 people who will look at them. As we will reaveal below, there were few problems going arround human appreceptions for something 'perfectly smooth' andrepparttar 107622 matchematical perfect figures. Methodology We were going to extensively use PHP GD library forrepparttar 107623 text effects. It provided easy changing of fonts and colors, adding drop shawdows and rotatingrepparttar 107624 texts. We had also to create color palletes which to appear when user click and disappear when color is selected (You can personally tryrepparttar 107625 decals creating here). Using hidden layers and javascript was supposed to dorepparttar 107626 work. The main problem in this site was to create 4 types of arcs so whenrepparttar 107627 user selects one of themrepparttar 107628 text is created arround imaginary arc (like inrepparttar 107629 vector graphical softwares). We were going to study Bezie's formulas and create these arcs with its help. Implementation PIM Team Bulgaria hadrepparttar 107630 task to buildrepparttar 107631 full functional online decals builder withrepparttar 107632 following features: - Decal background Some users were supposed to have their decals placed on colored background. We had to allowrepparttar 107633 preview area to be painted in a selected background. First we createdrepparttar 107634 image in temp folder: //repparttar 107635 name of destination image $dest='decals/'.time().'.jpg';

//the background imagefilledrectangle ( $im, 0, 0, 590, 60, $colors[$_POST['bcolors']]); $colors array containsrepparttar 107636 available color which are stored byrepparttar 107637 administrator inrepparttar 107638 database. Thus, whenrepparttar 107639 visitor selects a background it is passed as parametter to imagefilledrectangle function. - Font selection Users should be able to select fonts for their future decals. Knowing that we can't consider allrepparttar 107640 fonts will be available on all visitor's computers we had to upload them onrepparttar 107641 web server directory. We allowedrepparttar 107642 admin to managerepparttar 107643 fonts, adding their names and uploading files in admin area. The fonts inrepparttar 107644 select box came fromrepparttar 107645 database. Selected font was passed inrepparttar 107646 call to imagettftext funtion which is drawing onrepparttar 107647 previously created image. - Color Selections The color selections had to be a palettes which appear when user clicks and disappear when color is selected. The palette had to look as a table with colors and these colors are also defined inrepparttar 107648 admin area so they had to come dynamicly. We had to seed a static javascript function with dynamic content. We created a PHP cycle which was takingrepparttar 107649 colors fromrepparttar 107650 database and then creating a string for HTML table. This table is then passed to a javascript function which createsrepparttar 107651 palletes withrepparttar 107652 help of hidden layers: function showTable(table) { mouseX = window.event.x + document.body.scrollLeft+25; if(table=='background') { var content=""; var y=460; }

if(table=='fonts') { var content=""; var y=690; }

: Counter Strike, The beginner of Broad Band Pc Gaming:

Written by Fahad Ahmed Bashir


: Counter Strike, The beginner of Broad Band Pc Gaming:

This isrepparttar world of 21st century,repparttar 107613 century of technologies. Every thing is fast now a days and as far asrepparttar 107614 Computers and games are concerned, they are atrepparttar 107615 top of all. Every one these days like playing games and some of them love it. Well few years ago PC gaming was not so advance and usually was single user based and if any one wanted to play with any other player then one must have an extra input or any compatible playing device . An era of new technology began afterrepparttar 107616 entrance of Network gaming or Multiplayer gaming which revolutionizedrepparttar 107617 PC gaming world. The term of multiplayer gaming was that from now on if a person wants to play a certain game with any other personrepparttar 107618 he can easily connect torepparttar 107619 other person’s computer using broad band internet connection . Usually beforerepparttar 107620 arrival of Broad Band, games were played thorough Modem. This was perfect in those days asrepparttar 107621 games were not too heavy and only few packets of data are sent and received. However overrepparttar 107622 years this scene has changed greatly.

SWITCHING TO BROADBAND: Now a days multiplayer games send and receive more data and therefore need faster protocol for sending and receiving data items. Amongst those of course is COUNTER STRIKE. Few years ago when there was no concept of Broad Band, one would really be able to get anything faster thanrepparttar 107623 ISDN connection. But today as compared torepparttar 107624 past we have much greater availability and much greater broad band technology like DSL and Cable Modem as compare to normal dialup modem. So PC gaming has become very much advance and high quality games can be played at a very high speeds. Counter Strike isrepparttar 107625 most popular multiplayer game using Broad Band Connection. THE GAME : Without any doubt it isrepparttar 107626 most popular game played overrepparttar 107627 years and isrepparttar 107628 modification of half life developed by Valve. It is FPS (First Person Shooter) type game and is totally action packed. The game is divided into two teams The Terrorist Forces and The Counter Terrorist Forces. The game is played on some Maps which have different locations and objectives. According to these Mapsrepparttar 107629 Counter Terrorists andrepparttar 107630 Terrorist Forces assassinate/ Escapes, Hostages/ Rescues and diffuse bomb etc..

Cont'd on page 2 ==>
 
ImproveHomeLife.com © 2005
Terms of Use