Php QR code watermark images support ios, android, and win8

Source: Internet
Author: User
Tags watermark images

To provide a QR code interface for the mobile app, you must support iso, android, and win8 mobile phones. You have found the third-party tool phpqrcode.

1. Download address

Source code download: https://github.com/t0k4rt/phpqrcode


2. Add watermark image and fragment code

The code is as follows: Copy code

$ Logo = 'logo.png ';

If (is_file ($ logo ))
    {
$ QR = imagecreatefromstring (file_get_contents ($ filename ));
$ Logo = imagecreatefromstring (file_get_contents ($ logo ));
$ QR_width = imagesx ($ QR );
$ QR_height = imagesy ($ QR );
$ Logo_width = imagesx ($ logo );
$ Logo_height = imagesy ($ logo );
$ Logo_qr_width = $ QR_width/5;
$ Scale = $ logo_width/$ logo_qr_width;
$ Logo_qr_height = $ logo_height/$ scale;
$ From_width = ($ QR_width-$ logo_qr_width)/2;
Imagecopyresampled ($ QR, $ logo, $ from_width, $ from_width, 0, 0, $ logo_qr_width, $ logo_qr_height, $ logo_width, $ logo_height );
Imagepng ($ QR, $ filename );
    }

 

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.