win8.1 unity静默调用打印机

前几天实现的,


1调用打印机首先就是要配置好打印机

因为有些打印机需要在添加设备里加入合适的,一般商家会提供,记得千万要选对平台,特别是win7 win8 32,64问题会很大


2调用方式

(1)使用外部第三方软件exe

(2)使用win自带软件

(3)自己进行打印


这里我选择的是第二种,1不好实现静默,3太麻烦,这里2使用是后台调用命令行


3颜色问题

因为有的打印机偏色很重,需要调整伽马值,所以如果是2的话一定要调对参数位置,有几个地方参数很相像的



补充如果系统没有可供调用的打印程序可以试试下面的程序

打印调用方式

f (GUI.Button(new Rect((Screen.width - 200) / 2, (Screen.height - 200) / 2, 200, 200), "Print Image"))
{
ProcessStartInfo info = new ProcessStartInfo(path + "/PrintImage.exe");
//info.Arguments = "F:/Temp/sample-icon.png";//default image width,height
info.Arguments = "F:/Temp/sample-icon.png,10,10,100,100";//assign Rectangle(x,y,width,height)
using (Process p = new Process())
{
p.StartInfo = info;
p.Start();
}
} 

下载地址http://download.csdn.net/detail/shenmifangke/9430552

参考网址http://forum.unity3d.com/threads/print-the-screen-shot-by-printer-from-unity.179762/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值