<?php


namespace Api\PhpServices\PG;


class GetImage
{
    public static function getCoupon(){
        //创建画布
        $im = imagecreatetruecolor(500, 600);

        $qr = new QR('abc');
        $qr_img = $qr->get();
        list($code_w,$code_h) = getimagesizefromstring($qr_img);
        $codeImg = imagecreatefromstring($qr_img);
        imagecopyresized($im, $codeImg, 0, 0, 0, 0, 170, 170, $code_w, $code_h);
        Header("Content-Type: image/png");
        imagepng ($im);

        imagedestroy($im);
    }

    public static function getLeaderShare(){

    }

    public static function getGoods(){

    }
}