imagecopy
Intervention/image
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Copy part of an image
imagecopy
(
GdImage $dst_image
,
GdImage $src_image
,
int $dst_x
,
int $dst_y
,
int $src_x
,
int $src_y
,
int $src_width
,
int $src_height
):
bool
$base
=
$image
->
getDriver
()->
newImage
(
$width
,
$height
)->
getCore
();
imagecopy
(
$base
,
$resource
,
0
,
0
,
0
,
0
,
$width
,
$height
);
imagefill
(
$resource
,
$x
,
$y
,
$filling
);
src/Intervention/Image/Gd/Commands/FillCommand.php
imagefill
(
$resource
,
$x
,
$y
,
$filling
);
imagecopy
(
$base
,
$resource
,
0
,
0
,
0
,
0
,
$width
,
$height
);
$image
->
setCore
(
$base
);
src/Intervention/Image/Gd/Commands/FillCommand.php
imagealphablending
(
$image
->
getCore
(),
true
);
return
imagecopy
(
$image
->
getCore
(),
$watermark
->
getCore
(),
$target
->
x
,
$target
->
y
,
0
,
0
,
$watermark_size
->
width
,
$watermark_size
->
height
);
}
}
src/Intervention/Image/Gd/Commands/InsertCommand.php
imagecolortransparent
(
$resource
,
$matte
);
imagecopy
(
$resource
,
$image
->
getCore
(),
0
,
0
,
0
,
0
,
$size
->
width
,
$size
->
height
);
if (
is_numeric
(
$count
) &&
$count
<=
256
) {
src/Intervention/Image/Gd/Commands/LimitColorsCommand.php
imagefilledrectangle
(
$canvas
->
getCore
(),
$dst_x
,
$dst_y
,
$dst_x
+
$src_w
-
1
,
$dst_y
+
$src_h
-
1
,
$transparent
);
imagecopy
(
$canvas
->
getCore
(),
$image
->
getCore
(),
$dst_x
,
$dst_y
,
$src_x
,
$src_y
,
$src_w
,
$src_h
);
$image
->
setCore
(
$canvas
->
getCore
());
src/Intervention/Image/Gd/Commands/ResizeCanvasCommand.php
imagealphablending
(
$canvas
,
true
);
imagecopy
(
$canvas
,
$resource
,
0
,
0
,
0
,
0
,
$width
,
$height
);
imagedestroy
(
$resource
);
$resource
=
$canvas
;
src/Intervention/Image/Gd/Decoder.php
$transparency
=
imagecolorallocatealpha
(
$clone
,
0
,
0
,
0
,
127
);
imagefill
(
$clone
,
0
,
0
,
$transparency
);
imagecopy
(
$clone
,
$core
,
0
,
0
,
0
,
0
,
$width
,
$height
);
return
$clone
;
}
src/Intervention/Image/Gd/Driver.php