As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center提供指导。
已关闭8年。
PHP GD库中的这两个函数有什么区别?
因此,
已关闭8年。
PHP GD库中的这两个函数有什么区别?
最佳答案
这两个功能非常相似,因为它们将一张图片复制到另一张图片中。
这些功能的不同之处在于最后一个参数:imagecopy()
始终用源像素的源像素覆盖目标中的所有像素,而imagecopymerge()
将目标像素与源像素的像素合并,并在额外参数中指定:
0 means "keep the source picture fully",
100 means "overwrite with the source picture fully",
and 50 means "mix the source and destination pixel colours equally".
因此,
imagecopy()
函数等效于调用imagecopymerge()
并传入100作为最后一个参数。