警告:此 API 已弃用。请改用积极维护的 Google Charts API。有关详细信息,请参阅我们的弃用政策
您将 QR 有效负载传递到 API 端点并获得图像作为回报:
https://quickchart.io/qr?text=Hello世界
或
另一种选择是图像图表 (高度可靠,部署在世界各地的数据中心,亚秒级响应时间)
我发现的另一项免费服务这里
https://qrcode.tec-it.com/API/QRCode?data=Helloworld
不幸的是,据我了解,Chart API 没有这样的功能。
但您可以通过使用 CSS 来使用 Image-Overlay。
像这样:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
.qrcode
{
position: relative;
top: 0;
left: 0;
width: 200px;
height: 200px;
}
.shell
{
position: absolute;
top: 80px;
left: 80px;
width: 40px;
height: 40px;
}
</style>
</head>
<body>
<div style="position: relative; left: 0; top: 0;">
<img class="qrcode" src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world&choe=UTF-8" alt="QR code" />
<img class="shell" src="YOUR IMAGE'S URL" />
</div>
</body>
</html>
您可以在此处查看我的示例页面。
但请注意,Chart 的 QRcode API 已被弃用。