从ASP.NET中的BarCode下面删除文本(C#)
发布时间:2020-12-16 07:33:44 所属栏目:asp.Net 来源:网络整理
导读:我正在生成条形码生成的条形码工作正常条码也完美读取它.关键字生成条码生成: private void GenerateBarCode(string codeInfo){ //Settings for the Image string TypeFaceName = "IDAutomationHC39M"; string imageLocation = Server.MapPath("2010.png");
我正在生成条形码生成的条形码工作正常条码也完美读取它.关键字生成条码生成:
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(); } alt text http://www.freeimagehosting.net/uploads/0e033f305b.png 现在我想删除条形码下面的文字. 解决方法
一个更好的选择可能是只使用一开头没有文本的字体:
尝试类似:Free Barcode Font – Code 39 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 为什么IIS7需要很长时间
- asp.net – 如何让Sitecore(和我的浏览器)使用Print布局?
- iis – Perfmon:哪个计数器标识线程正在等待?
- 如何通过GSM调制解调器从ASP.NET应用程序发送SMS
- asp.net-mvc – MVC路由错误:约束条目’长度’
- asp.net – NHibernate线程安全与会话
- 如何使用ASP.NET和iframe对跨域的用户进行身份验证?
- asp.net-mvc-3 – 在ASP.NET MVC中使用多个部分时重复输入i
- 基于声明的身份 – 在asp.net MVC5 EF6中使用流畅的api映射
- asp.net – Handler类代码没有触发
推荐文章
站长推荐
热点阅读