UniPRT SDK  v2.0.0.3
UniPRT.Sdk.LabelMaker.PglLib.PGL_Utilities类 参考

静态 Public 成员函数

static byte[] WindowsFont (string imageName, int fontSize, int rotation, int fontStyle, string fontFamilyName, string content)
 根据传入参数将指定文字绘制为图像,并封装在 ~LOGO 指令中。 更多...
 

详细描述

示例

using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using UniPRT.Sdk.Comm;
using UniPRT.Sdk.LabelMaker.PglLib; // imports SDK namespace
namespace Snippets
{
class MyLabel
{
public static void MainComm(string[] args)
{
byte[] download = PGL_Utilities.WindowsFont("TMP", 50, 0, 3, "Arial", "TestString");
UniPRT.Sdk.LabelMaker.PGL.Label lbl = new UniPRT.Sdk.LabelMaker.PGL.Label("PictureLabel");
Picutre picutre = new Picutre(new Point(0f, 0f), "TMP");
lbl.AddObject(picutre);
string str = lbl.ToString();
Console.WriteLine(str);
//var comm = new TcpConnection("192.168.101.56", 9100);
var comm = new UsbConnection();
comm.Open();
if (comm.Connected)
{
comm.Write(download);
comm.Write(Encoding.UTF8.GetBytes(str));
}
comm.Close();
}
}
}

成员函数说明

◆ WindowsFont()

static byte [] UniPRT.Sdk.LabelMaker.PglLib.PGL_Utilities.WindowsFont ( string  imageName,
int  fontSize,
int  rotation,
int  fontStyle,
string  fontFamilyName,
string  content 
)
static

根据传入参数将指定文字绘制为图像,并封装在 ~LOGO 指令中。

参数
[in]fontSize字体大小(像素)
[in]rotation文字旋转角度(90度/180度/270度/360度)
[in]fontStyle0:正常,1:粗体,2:斜体,3:粗体+斜体
[in]fontFamilyName字体名称
[in]content要绘制的文字
UniPRT.Sdk.LabelMaker.Interfaces
Definition: Coordinate.cs:7
UniPRT.Sdk.LabelMaker
Definition: Coordinate.cs:7
UniPRT
提供对不同通信接口/端口的支持
Definition: Communication.cs:9
UniPRT.Sdk.Comm
Definition: Communication.cs:9
UniPRT.Sdk
Definition: Communication.cs:9
UniPRT.Sdk.LabelMaker.PGL
Definition: Barcode1D.cs:9
UniPRT.Sdk.LabelMaker.PGL.Label
Definition: Label.cs:11
UniPRT.Sdk.LabelMaker.PglLib
Definition: Utilities.cs:12