^GFa,b,c,d,data command, how calculate the parameters?

M Michal Pawlowski 2 years 11 months ago
335 0 0

Hi.

I have .PNG file, which has 800x800 px size (it is monochrome). I want to print it.

I use:

string ConvertToHex(string inputFilePath){     var bytes = File.ReadAllBytes(inputFilePath);     var hexString = string.Join("", bytes.Select(x => x.ToString("X2")));     return hexString;}//...string hexBytes = ConvertToHex(@"TEST.png");int length = binaryData.Length;int length = binaryData.Length;int inRow = length / 16;string str = "^XA^FO0,0^GFA," + length + "," + length + "," + inRow + "," + hexBytes + "^XZ";
but when I send it, it doesn't print corectly, it prints one cm of different pixels.

How to calculate length of image and inRow bytes?

Thanks Mike

CONTACT
Can’t find what you’re looking for?