This is a utility class for printing images on a printer.
Namespace:
ZSDK_API.PrinterAssembly: ZSDK_API (in ZSDK_API.dll) Version: 1.1.123.0
Syntax
C# |
---|
public interface GraphicsUtil |
Visual Basic (Declaration) |
---|
Public Interface GraphicsUtil |
Examples
Print an image from the device to a printer.
CopyC#
using System; using ZSDK_API.Comm; using ZSDK_API.ApiException; using ZSDK_API.Printer; try { String myMacAddress = "00037700FF00"; ZebraPrinterConnection zebraPrinterConnection = new BluetoothPrinterConnection(myMacAddress); zebraPrinterConnection.Open(); ZebraPrinter printer = ZebraPrinterFactory.GetInstance(zebraPrinterConnection); int x = 100; int y = 200; printer.GetGraphicsUtil().PrintImage(@"\My Documents\My Pictures\sample.jpg", x, y); zebraPrinterConnection.Close(); } catch (ZebraPrinterConnectionException e) { Console.Write(e.StackTrace); }
CopyVB.NET
Imports ZSDK_API.ApiException Imports ZSDK_API.Comm Imports ZSDK_API.Printer Try Dim myMacAddress As [String] = "00037700FF00" Dim zebraPrinterConnection As ZebraPrinterConnection = New BluetoothPrinterConnection(myMacAddress) zebraPrinterConnection.Open() Dim printer As ZebraPrinter = ZebraPrinterFactory.GetInstance(zebraPrinterConnection) Dim x As Integer = 100 Dim y As Integer = 200 printer.GetGraphicsUtil().PrintImage("\My Documents\My Pictures\sample.jpg", x, y) zebraPrinterConnection.Close() Catch e As ZebraPrinterConnectionException Console.Write(e.StackTrace) End Try