Generating IDAutomationHC39M barcode is generating well but need to remove value

笑着哭i 提交于 2019-12-11 15:22:34

问题


Hi I am using below code and the bar code is generating well but how can I remove text written down to label.

 public void generateBarcode(string id)
    {
        int w = id.Length * 55;
        Bitmap oBitmap = new Bitmap(w, 100);
        Graphics oGraphics = Graphics.FromImage(oBitmap);
        Font oFont = new Font("IDAutomationHC39M", 18);
        PointF oPoint = new PointF(2f, 2f);
        SolidBrush oBrushWrite = new SolidBrush(Color.Black);
        SolidBrush oBrush = new SolidBrush(Color.White);
        oGraphics.FillRectangle(oBrush, 0, 0, w, 100);
        oGraphics.DrawString("*" + id + "*", oFont, oBrushWrite, oPoint);
        System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();

        using (System.IO.FileStream fs = System.IO.File.Open(Server.MapPath("~/img/barcodes/") + id + ".jpg", FileMode.Create))
        {
            oBitmap.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);

        }
        oBitmap.Dispose();
        imgbarcode.ImageUrl = "~/img/barcodes/" + id + ".jpg";
}

My bar code is generating as below. Here I need to remove the bar code text as 76


回答1:


According to this, the font you need to use without text is "IDAutomationC39M". Unfortunately, that's not in the free version.



来源:https://stackoverflow.com/questions/46181783/generating-idautomationhc39m-barcode-is-generating-well-but-need-to-remove-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!