<?php
GdImage|false imagecreatefromgd2part ( string $filename,
int $x,
int $y,
int $width,
int $height )
where,
$filename = The path to an existing GD2 image
$x = x-coordinate of source point
$y = y-coordinate of source point
$width = The source width
$height = The source height
?>
STREAM WRAPPERS | MEANING |
file:// | LOCAL File System |
http:// | URL HTTP |
ftp:// | URL FTP |
php:// | I/O streams |
zlib:// | Data Compression stream |
data:// | DATA (RFC-2397) |
glob:// | Find Filenames |
phar:// | PHP Archive |
ssh2:// | Secure Shell 2 |
rar:// | RAR |
ogg:// | Audio |
expect:// | Interaction of stream processes |
ed48 |
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$src_file = "gd2/GD2 004 03 (gif2gd2).gd2";
if (file_exists($src_file))
{
echo '<br>Source Image:<br><br>';
echo $src_file . '<br><br>';
echo '<br><br>The image EXISTS...<br>
BUT CAN NOT BE DISPLAYED by this browser!<br><br><br>';
$src_file_x = 110;
$src_file_y = 110;
$sec_file_w = 167;
$sec_file_h = 125;
$im01 =
imagecreatefromgd2part($src_file, $src_file_x,
$src_file_y, $sec_file_w, $sec_file_h);
// var_dump($im01);
$dst_file = "jpeg/JPEG 013 01 (gd2part2jpeg).jpg";
echo '<br><br>Target Image:';
echo '<br><br>' . $dst_file . '<br><br>';
imagejpeg($im01, $dst_file, 90);
?>
<img src="<?php echo $dst_file; ?>"
alt="<?php echo $dst_file; ?>"
title="<?php echo $$lang; ?>"><br><br>
<?php
imagedestroy($im01);
}
else
{
echo 'The SOURCE image DOES NOT EXIST!';
echo $src_file;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current browsers, do not support .gd2.
Therefore, files in this format should be transformed
at .gif, .jpg or .png - to be displayed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
?>