資源簡介
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
namespace?CSHARP_POSTEK_PRINT
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????PrintLab.OpenPort(“POSTEK?G-2108“);//打開打印機端口
????????????PrintLab.PTK_ClearBuffer();???????????//清空緩沖區
????????????PrintLab.PTK_SetPrintSpeed(4);????????//設置打印速度
????????????PrintLab.PTK_SetDarkness(10);?????????//設置打印黑度
????????????PrintLab.PTK_SetLabelHeight(600?16);?//設置標簽的高度和定位間隙\黑線\穿孔的高度
????????????PrintLab.PTK_SetLabelWidth(800);??????//設置標簽的寬度
????????????for?(int?i?=?1;?i?<=?1;?i++)
????????????{
????????????????//PrintLab.PTK_DrawTextTrueTypeW(200?300?40?40?“宋體“?1?400?false?true?true?“1“?“12456789“);//打印一行?TrueType?Font文字
????????????????//PrintLab.PTK_DrawBarcode(100?20?0?“1“?3?3?80?‘N‘?“12345“);//打印一個條碼
????????????????//PrintLab.PTK_SetPagePrintCount(1?1);//命令打印機執行打印工作
????????????????//?畫矩形
????????????????PrintLab.PTK_DrawRectangle(58?15?3?558?312);
????????????????
????????????????//?打印PCX圖片?方式一
????????????????PrintLab.PTK_PcxGraphicsDel(“PCX“);
????????????????PrintLab.PTK_PcxGraphicsDownload(“PCX“?“logo.pcx“);
????????????????PrintLab.PTK_DrawPcxGraphics(80?20?“PCX“);
????????????????
????????????????//?打印PCX圖片?方式二
????????????????//?PTK_PrintPCX(8030pchar(‘logo.pcx‘));
????????????????//?打印一個條碼;
????????????????PrintLab.PTK_DrawBarcode(300?23?0?“1“?2?2?50?‘B‘?“123456789“);??????????????
????????????????//?畫表格分割線
????????????????PrintLab.PTK_DrawLineOr(58?100?500?3);???????????????
????????????????//?打印一行TrueTypeFont文字;
????????????????PrintLab.PTK_DrawTextTrueTypeW(80?120?40?0?“Arial“?1?400?false?false?false?“A1“?“TrueTypeFont“);????????????????
????????????????//?打印一行文本文字(內置字體或軟字體);
????????????????PrintLab.PTK_DrawText(80?168?0?3?1?1?‘N‘?“Internal?Soft?Font“);
????????????????
????????????????//?打印PDF417碼
????????????????PrintLab.PTK_DrawBar2D_Pdf417(80?210?400?300?0?0?3?7?10?2?0?0?“123456789“);//PDF417碼
????????????????
????????????????//?打印QR碼
????????????????PrintLab.PTK_DrawBar2D_QR(420?120?180?180?0?3?2?0?0?“Postek?Electronics?Co.?Ltd.“);
????????????????
????????????????//?打印一行TrueTypeFont文字旋轉;
????????????????PrintLab.PTK_DrawTextTrueTypeW(520?102?22?0?“Arial“?2?400?false?false?false?“A2“?“www.postek.com.cn“);
????????????????PrintLab.PTK_DrawTextTrueTypeW(80?260?19?0?“Arial“?1?700?false?false?false?“A3“?“Use?different?ID_NAME?for?different?Truetype?font?objects“);
????????????????
????????????????//?命令打印機執行打印工作
????????????????PrintLab.PTK_PrintLabel(1?1);
????????????????PrintLab.ClosePort();//關閉打印機端
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3282??2012-03-14?09:19??C#?TEST\Backup\CSHARP_POSTEK_PRINT.csproj
?????文件????????926??2006-12-25?15:21??C#?TEST\Backup\CSHARP_POSTEK_PRINT.sln
????..A..H.?????19968??2013-10-12?13:28??C#?TEST\Backup\CSHARP_POSTEK_PRINT.v12.suo
?????文件???????6101??2013-10-12?13:22??C#?TEST\Backup\Form1.cs
?????文件???????3086??2012-12-07?19:01??C#?TEST\Backup\Form1.Designer.cs
?????文件???????5814??2012-12-07?19:01??C#?TEST\Backup\Form1.resx
?????文件????????478??2006-12-25?15:21??C#?TEST\Backup\Program.cs
?????文件???????1194??2006-12-25?15:21??C#?TEST\Backup\Properties\AssemblyInfo.cs
?????文件???????2862??2012-03-14?09:05??C#?TEST\Backup\Properties\Resources.Designer.cs
?????文件???????5612??2006-12-25?15:21??C#?TEST\Backup\Properties\Resources.resx
?????文件???????1117??2012-03-14?09:05??C#?TEST\Backup\Properties\Settings.Designer.cs
?????文件????????249??2006-12-25?15:21??C#?TEST\Backup\Properties\Settings.settings
?????文件??????24576??2013-10-12?13:22??C#?TEST\bin\Debug\CSHARP_POSTEK_PRINT.exe
?????文件??????30208??2013-10-12?13:22??C#?TEST\bin\Debug\CSHARP_POSTEK_PRINT.pdb
?????文件??????21656??2020-03-16?11:17??C#?TEST\bin\Debug\CSHARP_POSTEK_PRINT.vshost.exe
?????文件????????490??2017-07-12?18:30??C#?TEST\bin\Debug\CSHARP_POSTEK_PRINT.vshost.exe.manifest
?????文件???????1493??2012-12-06?17:05??C#?TEST\bin\Debug\logo.pcx
?????文件??????86016??2013-10-31?16:21??C#?TEST\bin\Debug\WINPSK.dll
?????文件???????3553??2020-03-16?11:17??C#?TEST\CSHARP_POSTEK_PRINT.csproj
?????文件???????1006??2020-03-16?11:17??C#?TEST\CSHARP_POSTEK_PRINT.sln
????..A..H.?????19968??2013-10-12?13:28??C#?TEST\CSHARP_POSTEK_PRINT.suo
????..A..H.?????35840??2020-03-16?11:18??C#?TEST\CSHARP_POSTEK_PRINT.v12.suo
?????文件???????6101??2013-10-12?13:22??C#?TEST\Form1.cs
?????文件???????3086??2012-12-07?19:01??C#?TEST\Form1.Designer.cs
?????文件???????5814??2012-12-07?19:01??C#?TEST\Form1.resx
?????文件????????352??2006-12-25?16:43??C#?TEST\obj\CSHARP_POSTEK_PRINT.csproj.FileList.txt
?????文件???????2400??2013-10-12?13:22??C#?TEST\obj\CSHARP_POSTEK_PRINT.csproj.FileListAbsolute.txt
?????文件????????202??2020-03-16?11:17??C#?TEST\obj\Debug\CSHARP_POSTEK_PRINT.csproj.FileListAbsolute.txt
?????文件????????842??2012-12-07?19:01??C#?TEST\obj\Debug\CSHARP_POSTEK_PRINT.csproj.GenerateResource.Cache
?????文件??????24576??2013-10-12?13:22??C#?TEST\obj\Debug\CSHARP_POSTEK_PRINT.exe
............此處省略25個文件信息
評論
共有 條評論