UniPRT SDK  v2.0.0.3
UniPRT.Sdk.LabelMaker.PglLib.PGL_Utilities Class Reference

Static Public Member Functions

static byte[] WindowsFont (string imageName, int fontSize, int rotation, int fontStyle, string fontFamilyName, string content)
 Renders the specified text as an image based on the given parameters, and wraps it in a ~LOGO command. More...
 

Detailed Description

Examples

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();
}
}
}

Member Function Documentation

◆ WindowsFont()

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

Renders the specified text as an image based on the given parameters, and wraps it in a ~LOGO command.

Parameters
[in]fontSizeFont size (in pixel)
[in]rotationText rotation angle (90/180/270/360 degrees)
[in]fontStyle0: Normal, 1: Bold, 2: Italic, 3: Bold + Italic
[in]fontFamilyNameFont family name
[in]contentText to render
UniPRT.Sdk.LabelMaker.Interfaces
Definition: Coordinate.cs:7
UniPRT.Sdk.LabelMaker
Definition: Coordinate.cs:7
UniPRT
Provide support for different communication interfaces/ports.
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