Home > Backend Development > PHP Tutorial > 【imagecolorset】qrcode生成二维码后,想把黑色二维码改成蓝色

【imagecolorset】qrcode生成二维码后,想把黑色二维码改成蓝色

WBOY
Release: 2016-06-20 12:43:58
Original
2340 people have browsed it

如题,我用qrcode生成一张二维码图片,然后想把黑色二维码修改为蓝色二维码,背景色不变。

<?phpinclude "../qijiang/phpqrcode.php";if(isset($_POST['addSub']) && $_POST['addSub'] =='生成二维码'){$url="BEGIN:VCARDVERSION:3.0FN:".$_POST['chineseName']."NICKNAME:".$_POST['englishName']."ORG:".$_POST['companyName']."TITLE:TEL;TYPE=work:".$_POST['officeTel']."TEL:".$_POST['tel']."EMAIL:".$_POST['mail']."END:VCARD";  $filename_temp ="card.png";  $errorCorrectionLevel = 'L';  $matrixPointSize = 2;  QRcode::png($url, $filename_temp, $errorCorrectionLevel, $matrixPointSize,4);$img = file_get_contents('card.png');$im = imagecreatefromstring($img);$indexColor=imagecolorexact($im,0,0,0);//echo "<script language='javascript'>alert('".$indexColor."');</script>";imagecolorset($im,$indexColor,0,0,255);  echo "<img  src=\"card.png\" alt="【imagecolorset】qrcode生成二维码后,想把黑色二维码改成蓝色" ><br/>";}?>
Copy after login


结果输出的card.php依旧是黑色的,求救。


回复讨论(解决方案)

求救,新手。

已解决,忘保存这个图片了,唉。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template