如何生成圆形二维码? 我想生成一个用圆圈而不是正方形绘制的二维码。我目前有这个代码:
public Bitmap GenerateQR(string text)
{
BarcodeWriter br = new BarcodeWriter();
EncodingOptions encodingOptions = new EncodingOptions()
{
Width = 300,
Height = 300,
Margin = 1,
PureBarcode = false,
};
encodingOptions.Hints.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
br.Options = encodingOptions;
br.Format = BarcodeFormat.QR_CODE;
if (!string.IsNullOrWhiteSpace(text))
{
br.Renderer = new BitmapRenderer()
{
Foreground = Color.Black,
Background = Color.White,
};
return br.Write(texto);
}
}
我使用 C# 和 Zxing 库。