使用這個代碼行波紋管生成QR碼圖像
private void button1_Click(object sender, EventArgs e)
{
string barcode = textBox1.Text;
Bitmap bitmap = new Bitmap(barcode.Length * 40, 150);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
Font oFont = new System.Drawing.Font("IDAutomationHC39M", 20);
PointF point = new PointF(2f, 2f);
SolidBrush white = new SolidBrush(Color.White);
SolidBrush black = new SolidBrush(Color.Black);
graphics.FillRectangle(white,0,0,bitmap.Width,bitmap.Height);
graphics.DrawString("*" + barcode + "*", oFont, black, point);
}
using (MemoryStream ms = new MemoryStream())
{
bitmap.Save(ms,ImageFormat.Png);
pictureBox1.Image = bitmap;
pictureBox1.Height = bitmap.Height;
pictureBox1.Width = bitmap.Width;
}
}
後我能夠產生該輸出圖像條形碼
我想要生成條形碼輸出像圖像下面我怎麼能達到這個
這是QR碼(https://開頭en.wikipedia.org/wiki/QR_code) – Idos
應該真的被關閉爲「搜索工具/庫「,但是因爲已經存在關於相同搜索的問題(關鍵問題),而不是關閉原因錯誤。 –
首先使用Google,查看您的問題是否已被問及回答! –