从下面的酒吧code在ASP.NET删除文本(C#) [英] Remove Text from below of the BarCode in ASP.NET(C#)
本文介绍了从下面的酒吧code在ASP.NET删除文本(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我生成了吧code一代栏code的工作正常吧code也perfectly.followin读它是code为酒吧code代:
I am generating the barcode generation of barcode is working fine barcode also read it perfectly.followin is the code for barcode generation:
private void GenerateBarCode(string codeInfo)
{
//Settings for the Image
string TypeFaceName = "IDAutomationHC39M";
string imageLocation = Server.MapPath("2010.png");
//The format of the image file
ImageFormat format = ImageFormat.Png;
//path of unique file name
string path = "D://MyProjects//RepeaterPaging//images//vijendra.png";
//REFERENCING A FONT
PrivateFontCollection fnts = new PrivateFontCollection();
fnts.AddFontFile("IDAutomationHC39M.ttf");
FontFamily fntfam = new FontFamily(TypeFaceName);
Font fnt = new Font(fntfam, 13);
fnts.AddFontFile("Arial.ttf");
FontFamily fntfam2 = new FontFamily("Arial", fnts);
//DRAWING THE IMAGE
Bitmap bmp = new Bitmap(960, 386); //Canvas size
Graphics g = Graphics.FromImage(bmp);
Bitmap orignBitmap = new Bitmap(imageLocation);
g.Clear(Color.Transparent); //Background color
SizeF bc = g.MeasureString(codeInfo, fnt);
Brush br = new SolidBrush(Color.Black);
g.DrawImage(orignBitmap, 10, 8);
g.DrawString(codeInfo, fnt, br, 585, 170); //Drawing the Image
g.TextRenderingHint=
bmp.Save(path, format); //Saving the Image file
bmp.Dispose(); //Releasing all resources (Image file)
Response.Clear();
}
现在我想删除这是楼下酒吧code的文本。
我该怎么办呢?
Now I want to remove the text which is below of the barcode. how can I do this?.
推荐答案
一个更好的替代方案可能是只使用不具有在首位文本的字体:
A better alternative might be to just use a font that doesn't have the text in the first place:
试着这么做:免费酒吧code字体 - code 39
这篇关于从下面的酒吧code在ASP.NET删除文本(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文