TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-25-2008, 04:23 PM   #1 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default Remembering the GD Library?

Its hard to remember anyone got any tips on remembering basic GD?
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote
Old 03-25-2008, 04:38 PM   #2 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

I would have a look at Rendair's absolutely amazing GD articles!

TalkPHP - The Big GD Guide - Part 1
TalkPHP - The Big GD Guide - Part 2
TalkPHP - The Big GD Guide - Part 3
Gareth is offline  
Reply With Quote
The Following User Says Thank You to Gareth For This Useful Post:
Nor (03-25-2008)
Old 03-25-2008, 04:53 PM   #3 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

I read them, but the fact of me remembering them is a hard task for some reason, like the only thing I can't remember PHP wise.
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote
Old 03-25-2008, 05:00 PM   #4 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

We should make a "cheat sheet"!
Gareth is offline  
Reply With Quote
The Following User Says Thank You to Gareth For This Useful Post:
Nor (03-25-2008)
Old 03-25-2008, 05:01 PM   #5 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Make some notes keep them nearby when you're coding something.
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Nor (03-25-2008)
Old 03-25-2008, 06:00 PM   #6 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

Don't know if all, but almost all GD functions start with image :)
imagecolorallocate.. imageline.. etc
and the arguments are pretty much the same
image resource, x, y, w, h
or
image resource from_x, from_y, to_x, to_y...
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 03-25-2008, 08:06 PM   #7 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Oh and bookmark: PHP: Image - Manual
Salathe is offline  
Reply With Quote
Old 03-25-2008, 11:11 PM   #8 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

What i do is think of an application that would need me to use alot of different GD functions and then just keep adding to it and sooner or later you kind of just remember them.
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 03-26-2008, 12:01 AM   #9 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

PHP Code:
<?php



/**
**  How to get an image from a resource
**/

# Set the header
header("Content-Type: image/png");
# if this is empty then it would return an error
$file 'test.jpg';
# create it from $file
$im imagecreatefromjpeg($file);

# Makes it easier for PNG files to have their colors correct!
imagesavealpha($im,true);

# generate it as a png file

imagepng($im);

/**End**/

/**
* Make your own IMages!~!!!!!! YAYYAYAY
**/# Set the header
header("Content-Type: image/jpeg");
$x 200;
$y 100;


$r mt_rand(0,255);
$g $r;
$b $g;


 
$im imagecreatetruecolor($x,$y);
 
$col imagecolorallocate($im$r,$g,$b);
 
imagefilledrectangle($im,$x,$y,0,0,$col);


imagejpeg($im);

/**End**/
?>
__________________
VillageIdiot can have my babbies ;d

Last edited by Orc : 03-26-2008 at 12:22 AM.
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:51 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design