Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
PrintLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8c307787
由
刘韬
编写于
2022-10-08 13:35:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
83a938e3
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
28 行增加
和
7 行删除
PrintLabel/LabelPrint.cs
PrintLabel/Model.cs
PrintLabel/LabelPrint.cs
查看文件 @
8c30778
...
...
@@ -11,7 +11,7 @@ namespace BLL
/// <summary>
/// 标签打印
/// </summary>
internal
class
LabelPrint
public
class
LabelPrint
{
private
PictureBox
_pic
;
private
XmlDocument
_doc
;
...
...
@@ -205,17 +205,37 @@ namespace BLL
label
.
Path
=
file
[
i
];
label
.
Name
=
_root
.
Attributes
[
"Name"
].
Value
;
label
.
SetSize
(
_root
.
Attributes
[
"Size"
].
Value
);
if
(
_root
.
Attributes
[
"Offset"
]!=
null
)
label
.
SetOffset
(
_root
.
Attributes
[
"Offset"
].
Value
);
else
label
.
SetOffset
(
"0,0"
);
XmlNodeList
list
=
_root
.
ChildNodes
;
for
(
int
j
=
0
;
j
<
list
.
Count
;
j
++)
{
Model
.
LabelFieldType
type
=
Model
.
LabelFieldType
.
Text
;
if
(
int
.
TryParse
(
list
[
j
].
Attributes
[
"Type"
].
Value
,
out
_
))
{
type
=
(
Model
.
LabelFieldType
)
Convert
.
ToInt32
(
list
[
j
].
Attributes
[
"Type"
].
Value
);
}
else
{
Enum
.
TryParse
<
Model
.
LabelFieldType
>(
list
[
j
].
Attributes
[
"Type"
].
Value
,
out
type
);
}
string
key
=
""
;
if
(
list
[
j
].
Attributes
[
"Key"
]
!=
null
)
key
=
list
[
j
].
Attributes
[
"Key"
].
Value
;
else
if
(
list
[
j
].
Attributes
[
"Text"
]
!=
null
)
key
=
list
[
j
].
Attributes
[
"Text"
].
Value
;
Model
.
ClsLabelField
field
=
new
Model
.
ClsLabelField
{
Type
=
(
Model
.
LabelFieldType
)
Convert
.
ToInt32
(
list
[
j
].
Attributes
[
"Type"
].
Value
),
FormatText
=
list
[
j
].
Attributes
[
"Key"
].
Value
Type
=
type
,
FormatText
=
key
};
field
.
SetLocationSize
(
list
[
j
].
Attributes
[
"Rect"
].
Value
);
string
rect
;
if
(
list
[
j
].
Attributes
[
"Rect"
]
!=
null
)
rect
=
list
[
j
].
Attributes
[
"Rect"
].
Value
;
else
rect
=
list
[
j
].
Attributes
[
"Rectangle"
].
Value
;
field
.
SetLocationSize
(
rect
);
field
.
SetFont
(
list
[
j
].
Attributes
[
"Font"
].
Value
);
field
.
SetBarQRCode
(
field
.
FormatText
);
label
.
Field
.
Add
(
field
);
...
...
@@ -463,6 +483,7 @@ namespace BLL
/// <returns></returns>
public
Bitmap
PrintPreview
(
Dictionary
<
string
,
string
>
text
,
out
string
[]
codeContent
)
{
text
=
new
Dictionary
<
string
,
string
>(
text
,
StringComparer
.
OrdinalIgnoreCase
);
codeContent
=
null
;
if
(
labelIdx
==
-
1
)
return
null
;
...
...
@@ -861,7 +882,7 @@ namespace BLL
e
.
Graphics
.
DrawImage
(
field
.
Image
,
new
RectangleF
(
field
.
Location_px
,
field
.
Size_px
));
}
//边框
e
.
Graphics
.
DrawRectangle
(
Pens
.
LightGray
,
field
.
Location_px
.
X
,
field
.
Location_px
.
Y
,
field
.
Size_px
.
Width
,
field
.
Size_px
.
Height
);
//
e.Graphics.DrawRectangle(Pens.LightGray, field.Location_px.X, field.Location_px.Y, field.Size_px.Width, field.Size_px.Height);
}
}
...
...
PrintLabel/Model.cs
查看文件 @
8c30778
...
...
@@ -290,7 +290,7 @@ namespace Model
//Height = 70,
Margin
=
1
};
writer
.
Options
.
PureBarcode
=
true
;
switch
(
Type
)
{
case
LabelFieldType
.
Code39
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论