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

使用 EPL2 打印語言打印 bmp 文件時出現大黑線

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

問題描述

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

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

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

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)打印機打印的內容

(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 格式將該行添加為行尾標記,并且在呈現時不可行.我想在我擁有二進制數組并取出每行末尾的 00 00 00 后,我可能必須重新解析文件.但我在這里發帖以防萬一有人想到更好的方法.

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 位圖始終填充為偶數 32 位.生成位圖時,將寬度四舍五入到 32 的倍數就可以了.

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.

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

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

相關文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動)
C# Console app - How do I make an interactive menu?(C# 控制臺應用程序 - 如何制作交互式菜單?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創建重復的表單?)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應用程序并單擊菜單條)
Removing thin border around the menuitems(刪除菜單項周圍的細邊框)
主站蜘蛛池模板: 中文一级片 | 视频一区在线观看 | 黄色一级影片 | 久久精品久久久 | 亚洲精品视频在线播放 | 久久夜色精品国产欧美乱极品 | 国产精品二| 激情久久综合 | 成人福利在线观看 | 中文字幕在线免费播放 | 一级免费毛片 | 欧美精品xxx | 久久精品免费观看 | 久久免费视频网站 | 日产毛片 | 日韩福利一区 | 夜色在线影院 | 一本一道久久a久久精品蜜桃 | 黄色a一级片 | 四虎在线观看视频 | 玖玖视频在线 | 欧美一级黄色录像 | 精品久久久久久久久久久久久久久久 | 中文字幕一区二区三区四区视频 | 日本婷婷| 国产精品入口 | 成人午夜激情视频 | 毛片久久 | 一级片久久久 | 成人香蕉网 | 亚洲精品成人 | 九九精品在线观看 | 天天综合久久 | 一级片在线 | 欧美一区二区三区在线视频 | 在线免费看黄网站 | 伊人久久网站 | 欧美精品一二三区 | 艳妇臀荡乳欲伦交换h漫 | 国产精品99久久久久久久久久久久 | 青青草网站 |