Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能建议:画线画框的方法 #3

Closed
nletech opened this issue Dec 19, 2019 · 2 comments
Closed

功能建议:画线画框的方法 #3

nletech opened this issue Dec 19, 2019 · 2 comments

Comments

@nletech
Copy link

nletech commented Dec 19, 2019

最近一直在关注这个项目,我也尝试用了一下,以后几点建议

  1. 缺少画线的方法
  2. 缺少画框的方法
  3. 最好能直接发送打印指令

谢谢

@thon-ju
Copy link
Owner

thon-ju commented Dec 19, 2019

@nletech 谢谢你的关注,由于安卓和ios的sdk差异较大,暂不考虑增加太复杂的方法;
对于复杂的布局及图形,建议使用打印图片的方式,思路如下:
1、在打印预览界面进行复杂布局
2、使用[screenshot] 组件生成截图
3、使用打印托盘方式
示例参考

File image = await screenshotController.capture(pixelRatio: 5);
List<int> imageBytes = await image.readAsBytes();
String base64Image = base64Encode(imageBytes);

List<LineText> list = List();
list.add(LineText(type: LineText.TYPE_IMAGE, content: base64Image, 
                        align: LineText.ALIGN_CENTER, linefeed: 1));
await bluetoothPrint.print(list);

@thon-ju thon-ju pinned this issue Sep 8, 2020
@thon-ju thon-ju closed this as completed Sep 8, 2020
@mjl0602
Copy link

mjl0602 commented Mar 17, 2021

作者你好,如果打印整个widget的截图,打印机反应会非常慢。目前打印70*110尺寸的标签,打印一张需要30秒才能打印出来。

根据我们目前的测试,即使是打印全空白的widget,只要尺寸是70*110,就一定需要30秒才能打印出来。

所以想问一下,是机器的问题还是代码的问题,是否有能更快打印的打印机?

打印机型号:佳博3120TU
代码如下

    list1.add(LineText(
      type: LineText.TYPE_IMAGE,
      x: 8,
      y: 6,
      width: 530,
      content: base64Image,
    ));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants