# phpqrcode 海报生成版 **Repository Path**: chenic/phpqrcode ## Basic Information - **Project Name**: phpqrcode 海报生成版 - **Description**: 一个由phpqrcode扩展,能生成海报的二维码库 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 9 - **Forks**: 2 - **Created**: 2020-07-04 - **Last Updated**: 2024-04-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # phpqrcode 海报生成版 #### 介绍 一个由phpqrcode扩展,能生成海报的二维码库 #### 软件架构 基于 phpqrcode 扩展, #### 安装教程 1. 下载到项目文件夹即可 #### 使用说明 ```php include_once APPPATH . "third_party/phpqrcode/qrlib.php"; $bgFile = APPPATH . "assets/share-bg.png"; $fontDir = APPPATH . "/assets/font"; $nickname = "大有"; //生成海报 $image = QRcode::poster( 'http://www.baidu.com', //要生成的二维码内容 $bgFile, //海报背景 10, //二维码在背景上的 x 点 10, //二维码在背景上的 y 点 200, //二维码的大小 $fontDir, //字体文件的目录 [ //要显示的文本数组 [ "text"=>$nickname, //文本 'fontsize'=>30, //字体大小 'x'=>10, //文字的x点 'y'=>250, //文字的y点 'fontFile'=>'simhei.ttf', //字体文件名 'red'=>200, //三原色:红 'green'=>100, //三原色:绿 'blue'=>60, //三原色:蓝 ] ], [ 'level'=>QR_ECLEVEL_L,//容错等级 'size'=>3, //点的大小 'margin'=>4, //边距 ] ); //其它你要进行的 GD 图像操作 Header("Content-type: image/png"); ImagePng($image); ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request