class codeImg
{
private $date,$img,$main,$width,$height,$target,$white;
public function constr($source)
{
$this->date = '' . date('Ymd') . '/';
$this->img = $this->date . md5($source) . '.jpg';
$this->main = imagecreatefromjpeg($source);
$this->width = imagesx($this->main);
$this->height = imagesy($this->main);
$this->target = imagecreatetruecolor($this->width, $this->height);
$this->white = imagecolorallocate($this->target, 255, 255, 255);
imagefill($this->target, 0, 0, $this->white);
imagecopyresampled($this->target, $this->main, 0, 0, 0, 0, $this->width, $this->height, $this->width, $this->height);
}
/**
* 生成二维码
* @param [type] $web
php生成二维码到图片上
最新推荐文章于 2024-05-20 13:57:44 发布