Barcode条形码及对图片进行270翻转

该博客介绍了如何在C#中生成Barcode条形码,并通过Bitmap对象实现270度翻转。首先,使用BarcodeProfessional库创建条形码,然后将其保存为Bitmap对象。接着,通过Graphics对象对图片进行旋转操作,实现翻转效果。最后,将处理后的图片保存并返回其字节数据。
摘要由CSDN通过智能技术生成

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
using Neodynamic.WebControls.BarcodeProfessional;
using System.IO;

namespace WebApplication
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetImage();
            byte[] code = GetUpDownImage("888.png");

            if (code != null)
            {
                Response.Clear();
                Response.ContentType = "image/png";
                Response.BinaryWrite(code);


                Response.End();

            }
            else
            {
                Response.End();
            }

        }

        protected void btn_Click(object sender, EventArgs e)
        {
            Response.Write(txt.Text);
        }
       
        protected void GetImage()
        {
            //生成条码
            BarcodeProfessional bcp = new BarcodeProfessional(); //BarcodeProfessional第三方程序集
            bcp.Code = "W002054965001";
            bcp.Symbology = Symbology.Code39;

            byte[] barcodeImage = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Png);

            //if (barcodeImage != null)
            //{
            //    Response.Clear();
            //    Response.ContentType = "image/gif";
            //    Response.BinaryWri

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值