Csharp: QR Code Barcode, qrcode

Source: Internet
Author: User

Csharp: QR Code Barcode, qrcode

/// <Summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> protected void Page_Load (object sender, eventArgs e) {if (! IsPostBack) {qrCodeEncoder. QRCodeEncodeMode = QRCodeEncoder. ENCODE_MODE.BYTE; int scale = 4; qrCodeEncoder. QRCodeScale = scale; int version = 7; qrCodeEncoder. QRCodeVersion = version; qrCodeEncoder. QRCodeErrorCorrect = QRCodeEncoder. ERROR_CORRECTION.M; System. drawing. image image; String data = Request. url. absoluteUri ;//" http://www.dusystem.com/ Tu juwen "; image = qrCodeEncoder. encode (data); // picEncode. image = image; string filename = "geovinduQrcode.jpg"; string file = Server. mapPath (filename); image. save (file); this. image1.ImageUrl = filename ;}} /// <summary> //// </summary> /// <param name = "sender"> </param> /// <param name = "e "> </param> protected void button#click (object sender, eventArgs e) {QRCodeEncoder encoder = new QRCodeEncoder (); encoder. QRCodeErrorCorrect = QRCodeEncoder. ERROR_CORRECTION.H; // 30% encoder. QRCodeScale = 10; System. drawing. image img = encoder. encode ("www.dusystem.com"); string filename = "geovinduQrcodeVi.jpg"; string file = Server. mapPath (filename); string log = Server. mapPath ("nasa.bmp"); System. drawing. image logo = System. drawing. image. fromFile (log); int left = (img. width/2)-(logo. width/2); int top = (img. height/2)-(logo. height/2); Graphics g = Graphics. fromImage (img); g. drawImage (logo, new Point (left, top); string filename1 = "QrcodeVi.jpg"; img. save (Server. mapPath (filename1); this. image2.ImageUrl = filename1 ;}
 /// <summary>        ///         /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        protected void Page_Load(object sender, EventArgs e)        {            if (!IsPostBack)            {                System.Drawing.Image img;                Bitmap temp = new Bitmap(1, 1);                temp.SetPixel(0, 0, Color.Black);                img = (System.Drawing.Image)temp;                int W = 300;                int H = 150;                b.Alignment = BarcodeLib.AlignmentPositions.CENTER;                b.Alignment = BarcodeLib.AlignmentPositions.CENTER;                BarcodeLib.TYPE type = BarcodeLib.TYPE.UNSPECIFIED;                type = BarcodeLib.TYPE.CODE128;                b.LabelPosition = BarcodeLib.LabelPositions.BOTTOMCENTER;                b.IncludeLabel = true;                b.RotateFlipType = (RotateFlipType)Enum.Parse(typeof(RotateFlipType), "RotateNoneFlipNone", true);                img = b.Encode(type, "00800900000011", Color.Black, Color.White, W, H);                string filename = "geovindu.jpg";                string file = Server.MapPath(filename);                img.Save(file);                this.Image1.ImageUrl = filename;            }        }

 


C # Use the BarcodeControl bar code control to generate a bar code. How can I minimize the size of the generated bar code, because the printing process is too large, which wastes paper <div>
<Barcode: BarcodeImage ID = "bar1" runat = "server" BarcodeType = "CODE128B" CopyRightText = "" Data = "S014S037-20130513" Height = "80px" Width = "200px"/>
</Div>

Detune the height and width
C # Winfrom QRcode QR code printing. I know how to print a single bar code when the bar code is connected. But I don't know how to write it in bulk. help me write it on CSDN.
The font of the barcode is enough.

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.