Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
PrintLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1afba36f
由
刘韬
编写于
2022-11-15 09:31:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
176e4433
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
4 行删除
PrintLabel_Test/Form2.cs
ZebraPrinterHelper/ZebraManger.cs
ZebraPrinterHelper/ZebraPrinterHelper.csproj
PrintLabel_Test/Form2.cs
查看文件 @
1afba36
...
...
@@ -95,7 +95,7 @@ namespace PrintLabel_Test
MessageBox
.
Show
(
msg
);
}
else
MessageBox
.
Show
(
"连接成功
"
);
MessageBox
.
Show
(
"连接成功
,dpi:"
+
zebraManger
.
PrinterDPI
);
}
private
void
button5_Click
(
object
sender
,
EventArgs
e
)
...
...
ZebraPrinterHelper/ZebraManger.cs
查看文件 @
1afba36
...
...
@@ -48,6 +48,15 @@ namespace ZebraPrinterHelper
{
try
{
if
(
string
.
IsNullOrEmpty
(
ConnectionEndpoint
))
{
var
dl
=
GetUsbDirectAddress
();
if
(
dl
.
Count
==
0
)
{
new
Exception
(
"没有找到打印机"
);
}
ConnectionEndpoint
=
dl
.
First
().
Key
;
}
return
new
UsbConnection
(
ConnectionEndpoint
);
}
catch
(
Exception
e
)
...
...
@@ -161,8 +170,8 @@ namespace ZebraPrinterHelper
try
{
ZebraImageI
image
=
ZebraImageFactory
.
GetImage
(
bmp
);
var
width
=
image
.
Width
*
(
PrinterDPI
/
203f
);
var
height
=
image
.
Height
*
(
PrinterDPI
/
203f
);
var
width
=
image
.
Width
;
//
* (PrinterDPI/203f);
var
height
=
image
.
Height
;
//
* (PrinterDPI / 203f);
printer
.
PrintImage
(
image
,
0
,
0
,
(
int
)
width
,
(
int
)
height
,
false
);
return
true
;
}
...
...
@@ -208,6 +217,7 @@ namespace ZebraPrinterHelper
status
=
GetStatus
();
if
(
status
==
null
)
{
Close
();
ReTryCount
++;
if
(
ReTryCount
>
3
)
{
...
...
ZebraPrinterHelper/ZebraPrinterHelper.csproj
查看文件 @
1afba36
...
...
@@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E4F7AFC7-2F6D-4685-8350-3C05697428EA}</ProjectGuid>
<OutputType>
Exe
</OutputType>
<OutputType>
Library
</OutputType>
<RootNamespace>ZebraPrinterHelper</RootNamespace>
<AssemblyName>ZebraPrinterHelper</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
...
...
@@ -33,6 +33,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="SdkApi.Core">
<HintPath>..\Source\Sdk\SdkApi.Core.dll</HintPath>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论