Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android中的蓝牙打印机上打印图像_Android_Arrays_Printing_Bluetooth - Fatal编程技术网

在Android中的蓝牙打印机上打印图像

在Android中的蓝牙打印机上打印图像,android,arrays,printing,bluetooth,Android,Arrays,Printing,Bluetooth,我正在通过蓝牙打印机打印下面的图像 我指的是打印此链接。 图像大小为100 x 100 px,图像模式为 public static byte[] SELECT_BIT_IMAGE_MODE = {0x1B, 0x2A, 33, (byte)255, 0}; 但不知何故,它似乎是。我尝试了评论中给出的一些选项,但不起作用 有人能帮我吗?提前谢谢你好的,处理好了 使用130x130像素的图像 使用单个mService.write(PrinterCommands.FEED_行) 图像模式为 pu

我正在通过
蓝牙
打印机打印下面的图像

我指的是打印此链接。 图像大小为100 x 100 px,图像模式为

public static byte[] SELECT_BIT_IMAGE_MODE = {0x1B, 0x2A, 33, (byte)255, 0};
但不知何故,它似乎是。我尝试了评论中给出的一些选项,但不起作用

有人能帮我吗?提前谢谢你

好的,处理好了

使用130x130像素的图像 使用单个
mService.write(PrinterCommands.FEED_行)

图像模式为
publicstaticbyte[]选择位图像模式={0x1B,0x2A,33,(byte)255,0}

参考-

输出图像为


您可以将printooth库用于任何打印机,printooth非常简单,而且文档丰富,

var printables=ArrayList()
var printable=printable.PrintableBuilder()
.setImage(图像)
.setNewLinesAfter(1)//在句子后提供n行
.build()
可打印。添加(可打印)
BluetoothPrinter.printer().print(可打印)

你好。我有一个问题,如何将130x130 px设置为图像大小?@Faxriddin Abdullayev
bitmap.scale(130130)
在Kotlin中。您好,如何解决这个问题?有没有办法在Printooth中打印宽度超过256 px的图像?
var printables = ArrayList<Printable>()
var printable = Printable.PrintableBuilder()  
    .setImage(image) 
    .setNewLinesAfter(1) // To provide n lines after sentence
    .build()
printables.add(printable)
BluetoothPrinter.printer().print(printables)