imagecopyresized
(PHP 3, PHP 4 )
imagecopyresized -- Copy and resize part of an image
Description
int imagecopyresized ( resource dst_im, resource src_im, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
imagecopyresized() copies a rectangular portion of one image to another image. Dst_im is the destination image, src_im is the source image identifier. If the source and destination coordinates and width and heights differ, appropriate stretching or shrinking of the image fragment will be performed. The coordinates refer to the upper left corner. This function can be used to copy regions within the same image (if dst_im is the same as src_im) but if the regions overlap the results will be unpredictable.
See also imagecopyresampled().
User Contributed Notes
imagecopyresized
plusplus7 at hotmail dot com
25-Sep-1999 04:10
saw this one on the ng and it works fine - just trying to figure it out for jpg.
Code:
<?
$new_w=100;
$new_h=100;
header("Content-type: image/gif");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromGif("./imgtest.gif");
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
ImageGif($dst_img);
?>
source :
http://www.php.net/manual/en/functio...opyresized.php
take a look