打印到打印机斑马隐隐给人和模糊的图像 [英] Printing to Zebra printer gives faint and blurry images
问题描述
我写它创建一些用户的输入位图图像库。然后该位图使用的是斑马打印机打印。我遇到就是一切的问题是非常微弱和模糊的斑马打印机打印的图像上,但如果我打印的位图激光打印机,它看起来非常正常。有没有人,如果是他们是怎么解决它遇到这个?我已经试过几乎所有我能想到明智的打印机设置。
更新,其中code代表我如何创建位图图像。
公共静态位图GenerateLabel< T>(T OBJ,XmlDocument的模板)
{
尝试
{
INT宽度= Convert.ToInt32(template.SelectSingleNode(/标签/宽@)值。);
INT高度= Convert.ToInt32(template.SelectSingleNode(/标签/ @高)值。); 如果(OBJ == NULL ||高度< = 0 ||宽度LT; = 0)
抛出新的ArgumentException(没什么打印); 位图bLabel =新位图(宽,高);
图形G = Graphics.FromImage(bLabel); XmlNodeList中字段列表= template.SelectNodes(/标签/ LABEL); 的foreach(FieldList中XmlNode的fieldDetails)
{
//非重要code ... g.DrawImage(BBAR code,field.Left,field.Top);
使用(文本框txtbox =新的TextBox())
{
//更多的非重要code ... 矩形R =新的Rectangle(field.Left,field.Top,field.Width,field.Height);
txtbox.DrawToBitmap(bLabel,R);
}
} 返回bLabel;
}
赶上(异常前)
{
抛出新的异常(无法创建位图:+ ex.Message);
}
}
斑马打印驱动程序抖动你的输出。要创建斑马打印的完美形象,你将需要203 DPI和2色黑白(1位),以创建一个图像。
I wrote a library which creates a bitmap image from some user input. This bitmap is then printed using a zebra printer. The problem I am running into is everything is very faint and blurry on the image printed by the zebra printer but if I print the bitmap to a laser printer it looks perfectly normal. Has anyone run into this before and if so how did they fix it? I have tried nearly everything I can think of printer settings wise.
Updated with code for how I create the bitmap images.
public static Bitmap GenerateLabel<T>(T obj, XmlDocument template)
{
try
{
int width = Convert.ToInt32(template.SelectSingleNode("/LABELS/@width").Value);
int height = Convert.ToInt32(template.SelectSingleNode("/LABELS/@height").Value);
if (obj == null || height <= 0 || width <= 0)
throw new ArgumentException("Nothing to print");
Bitmap bLabel = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bLabel);
XmlNodeList fieldList = template.SelectNodes("/LABELS/LABEL");
foreach (XmlNode fieldDetails in fieldList)
{
//non important code...
g.DrawImage(bBarCode, field.Left, field.Top);
using (TextBox txtbox = new TextBox())
{
// more non important code...
Rectangle r = new Rectangle(field.Left, field.Top, field.Width, field.Height);
txtbox.DrawToBitmap(bLabel, r);
}
}
return bLabel;
}
catch (Exception ex)
{
throw new Exception("Unable to create bitmap: " + ex.Message);
}
}
The Zebra print driver is dithering your output. To create a perfect image for Zebra printing, you'll need to create an image at 203 DPI and 2-color black and white (1-bit).
这篇关于打印到打印机斑马隐隐给人和模糊的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!