Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage
Php > Graphics sample source codes
Easy to use image resizer and resampler
Easy to use image resizer and resampler ofcourse if the picture is rectangular all sides of the //-->copy will be equal if($size[0] < $size[1]) { $ratio = $size[1]/$cp_bigs; $dstW = $size[0] / $ratio; $dstH = $cp_bigs; } elseif($size[0] == $size[1]) { $dstW = $cp_bigs; $dstH = $cp_bigs; } else { $ratio = $size[0]/$cp_bigs; $dstW = $cp_bigs; $dstH = $size[1] / $ratio; } $srcW = $size[0]; $srcH = $size[1]; $imdst = ImageCreateTruecolor($dstW, $dstH); ImageCopyResampled($imdst, $im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); if($copydir) ImageJPEG($imdst, $copydir . "/" . $picname); else ImageJPEG($imdst); } } ?>
Privacy Policy
|
Link to Us
|
Links