Hello all PHPBuilder fans,
I'd like 2 ask a question abt PHP's Image function which i've used..
It goes like this:
I want to extract the middle portion of an image to create a thumbnail of proportion (80 times 80 pixels). I use ImageCopy, but am thinking that the values of the starting x and y-coordinates are not right. Any clues?
I'd like 2 know if these coordinates correspond to pixel value, as in (300,300) would be the lowest right value of a 300 times 300 image. True?
Here's my code. Help if u can. Appreciate ur effort very much! Thanks guys!
$dheight=80; //Thumbnail 1 Height : 80
$dwidth=80; //Thumbnail 1 Height : 80
$sx=($swidth/2) - 60; //Thumbnail 1 Starting X-Coordinate
$sy=($sheight/2) - 60; //Thumbnail 1 Starting Y-Coordinate
//Generate 80 X 80 Thumbnail
$dst=ImageCreateTrueColor($dwidth,$dheight);
ImageCopy ($dst, $src, 0, 0, $sx, $sy, $dwidth, $dheight);
ImageJpeg($dst,$img_folder_name . $thumbname);