久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 EPL2 打印語言打印 bmp 文件時出現(xiàn)大黑線

Large black line appears when printing bmp files using the EPL2 print language(使用 EPL2 打印語言打印 bmp 文件時出現(xiàn)大黑線)
本文介紹了使用 EPL2 打印語言打印 bmp 文件時出現(xiàn)大黑線的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

這是本主題的第三部分.第 1 部分、第 2 部分..

This is the 3rd part to this topic. Part 1, Part 2..

我能夠成功地將我的單色位圖打印到我的打印機,但是在打印項目時,圖像右側(cè)有一條大的黑色條紋.

I was successfully able to print my monochrome bitmap to my printer, however there is a large black stripe along the right of the image when the item prints.

這是原文

(Scanned in)打印機打印的內(nèi)容

(Scanned in)What the printer printed

生成二進制 blob 的代碼

Code to generate binary blob

Rectangle rect = new Rectangle(0, 0, Bitmap.Width, Bitmap.Height);
System.Drawing.Imaging.BitmapData bmpData = null;
byte[] bitVaues = null;
int stride = 0;
try
{
    bmpData = Bitmap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly, Bitmap.PixelFormat);
    IntPtr ptr = bmpData.Scan0;
    stride = bmpData.Stride;
    int bytes = bmpData.Stride * Bitmap.Height;
    bitVaues = new byte[bytes];
    System.Runtime.InteropServices.Marshal.Copy(ptr, bitVaues, 0, bytes);
}
finally
{
    if (bmpData != null)
        Bitmap.UnlockBits(bmpData);
}

string str = String.Format("GW{0},{1},{2},{3},", X, Y, stride, Bitmap.Height);
byte[] ascii = Encoding.ASCII.GetBytes(str);
byte[] buffer = new byte[ascii.Length + bitVaues.Length + 1];
Buffer.BlockCopy(ascii, 0, buffer, 0, ascii.Length);
Buffer.BlockCopy(bitVaues, 0, buffer, ascii.Length, bitVaues.Length);
buffer[buffer.Length - 1] = (byte)'
';
return buffer;

我最初的理論是 BMP 格式將該行添加為行尾標記,并且在呈現(xiàn)時不可行.我想在我擁有二進制數(shù)組并取出每行末尾的 00 00 00 后,我可能必須重新解析文件.但我在這里發(fā)帖以防萬一有人想到更好的方法.

My initial theory is the BMP format is adding that line as a end of line marker and is not viable when rendered. I am thinking I may have to reparse the file after I have the binary array and take out the 00 00 00 at the end of every line. But I am posting here in case anyone thinks of a better way.

推薦答案

Microsoft 位圖始終填充為偶數(shù) 32 位.生成位圖時,將寬度四舍五入到 32 的倍數(shù)就可以了.

Microsoft bitmaps are always padded to an even 32 bits. When you generate the bitmap, round the width up to a multiple of 32 and you should be fine.

這篇關(guān)于使用 EPL2 打印語言打印 bmp 文件時出現(xiàn)大黑線的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應(yīng)用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動)
C# Console app - How do I make an interactive menu?(C# 控制臺應(yīng)用程序 - 如何制作交互式菜單?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創(chuàng)建重復(fù)的表單?)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應(yīng)用程序并單擊菜單條)
Removing thin border around the menuitems(刪除菜單項周圍的細邊框)
主站蜘蛛池模板: 性高朝久久久久久久3小时 av一区二区三区四区 | 日韩在线播放视频 | 亚洲视频一区二区三区 | 久色| 一区二区免费在线 | 羞羞视频在线观看网站 | 日韩一区不卡 | 区一区二区三在线观看 | 天天爱综合| 一区视频| 欧美国产视频 | 国产一区二区麻豆 | 日韩午夜精品 | 欧洲一级视频 | 羞羞视频网 | 中文字幕一区二区三区在线观看 | 精品亚洲一区二区三区四区五区高 | 91欧美| 国产精品一区三区 | 网站黄色av | 亚洲天堂精品一区 | 九色网址 | 欧美亚洲国语精品一区二区 | 中国美女av | 日韩av成人在线 | h视频免费在线观看 | 欧美天堂在线 | 特黄毛片 | 久久久久成人精品 | 亚洲成色777777在线观看影院 | 免费99精品国产自在在线 | 日本欧美在线观看视频 | 求毛片| 日韩精品一区在线 | 欧美日韩国产高清 | 午夜在线精品 | 午夜久久久久 | 亚洲va欧美va人人爽午夜 | 亚洲欧美日韩在线不卡 | 91在线一区二区三区 | 亚洲色欲色欲www |