vb.net - Working with bitmaps to a ZPL label printer -


  dim bitmapFilePath string = ImagePath here ... dim bitmapFileData byte as () = System.IO.File In form of. ReadAllBytes (bitmapFilePath) dim fILESIZE integer = bitmapFileData.Length dim bitmapDataOffset integer as in the form of = 0 dim width integer = 50 '255 dim height integer =' 255 dim bitsPerPixel as integer = 1 dim bitmapDataLength integer = 400 dim widthInBytes as as double = Math.Ceiling (width / 8.0) dim bitmap (bitmapDataLength) byte Buffer.BlockCopy (bitmapFileData, bitmapDataOffset, bitmap, 0, bitmapDataLength) int i = 0 Step 1 to bitmapDataLength (i) = bitmap (i) for bitmap As the Xor & amp; HFF Next Dim ZPLImageDataString As String = BitConverter.ToString (bitmap) ZPLImageDataString = Change (ZPLImageDataString, "-", String.Empty) dim zplCommand (3) As String zplCommand (0) = "^ XA" zplCommand (1 ) = "^ FO20,20" Zplkmond (2) = "^ GFA," + Bitmepdatalengthktostring () + "," + Bitmepdatalengthktostring () + "," + Vidthinbitesktostring () + "" + Zplimagedtstring Zplkmond (3) = "^ XZ"   

This is a nonsense class that looks like someone applied photoshop noise filter in print out. I found the solution on the Zebra website, but that image was 255/255, I need it for a 50/50 image, but I do not know what I want to change the offset or Bitmapdatalog ...

Is your bitmap 1-bit color depth? You can not send colorful pictures in this way, they have to convert to B / W1-bit per pixel. You also need to make sure that your bitmapDataLength variable is correct, it should be the number of bytes of image sent to the printer. See the ^ GF command in it, you can see the image on your printer, then see the example after the ~ DG command in the manual

If you change some pictures and They have to be saved, so you can use it in Graphics Conversion Magician This will take care of color conversion for you, and ZPL ^ GF math and you can also store the image on your printer.

Comments