Reply to Crop from existing file to new X & Y

Crop from existing file to new X & Y new!
by kambing, 12 years, 8 months ago
Example from simple imagecopy

$image_width  = '600';
$image_height = '200';
$source_x = (int)$_POST['source_x'];
$source_y = (int)$_POST['source_y'];
$src = imagecreatefromjpeg('current_image.jpg');
$dest = imagecreatetruecolor($image_width, $image_height);
imagecopy($dest, $src, 0, 0, $source_x, $source_y, $image_width, $image_height);

With this class how do I crop current image according to new $source_x & $source_y?Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important