Giter VIP home page Giter VIP logo

qrcode's Introduction

二维码生成与美化工具

composer require lrq/qrcode:~1.0.0

如果只是想生成一个默认的二维码

use lrq\qrcode\QrcodeMain;

$str = 'test'; //初始化传入需要转化为二维码的字符串
$qrcode = new QrcodeMain($str); //初始化传入需要转化为二维码的字符串
$qrcode->execute();
$qrcode->png('qr1.png'); //保存图片
echo $qrcode->gif(); //输出<img /> 标签

部分美化参数如下

$qrcode->setOuterFrame(1) //外边框
    ->setMergeLevel($qrcode::MERGE_LEVEL_NO) //合并点
    ->setPixelPerPoint(5) //设置每个点的像素

    ->setLocator($qrcode::LOCATOR_TYPE_CIRCLE) //设置定位点样式
    ->setLocatorColor(99,200,18) //设置定位点颜色

    ->setFrontColorStatic(10,100,18) //设置前景色
    ->setBackgroundColorGradient($qrcode::GRADIENT_TYPE_LR2RB,[200,55,30],[100,110,210]) //设置渐变背景色

    ->setEptColor(0,0,0) //把某个颜色设置为透明色

    ->setDecal('test.jpg') //中间的贴图
    ->setDecalSize(0.1) //中间贴图的大小

    ->setLocator(null) //移除定位点
    ->setFrontColorGradient(null) //移除前景色渐变

qrcode's People

Contributors

lrquan avatar

Watchers

 avatar

Forkers

raygyoe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.