共用方式為


ReceiptPrintJob.DrawRuledLine 方法

定義

將指令新增至列印工作,以列印收據印表機站紙張上繪製的尺規線條。

public:
 virtual void DrawRuledLine(Platform::String ^ positionList, PosPrinterLineDirection lineDirection, unsigned int lineWidth, PosPrinterLineStyle lineStyle, unsigned int lineColor) = DrawRuledLine;
void DrawRuledLine(winrt::hstring const& positionList, PosPrinterLineDirection const& lineDirection, uint32_t const& lineWidth, PosPrinterLineStyle const& lineStyle, uint32_t const& lineColor);
public void DrawRuledLine(string positionList, PosPrinterLineDirection lineDirection, uint lineWidth, PosPrinterLineStyle lineStyle, uint lineColor);
function drawRuledLine(positionList, lineDirection, lineWidth, lineStyle, lineColor)
Public Sub DrawRuledLine (positionList As String, lineDirection As PosPrinterLineDirection, lineWidth As UInteger, lineStyle As PosPrinterLineStyle, lineColor As UInteger)

參數

positionList
String

Platform::String

winrt::hstring

尺規線條的位置參數。 positionList的字元字串會視lineDirection指定水平尺規線或垂直尺規線條而有所不同, (請參閱備註) 。

lineDirection
PosPrinterLineDirection

列印尺規線條的方向。

lineWidth
UInt32

unsigned int

uint32_t

列印應該列印之尺規線條的寬度。 寬度單位為點。 如果指定了不支援的值,則會使用印表機的最佳適合值。

lineStyle
PosPrinterLineStyle

尺規線的外觀,例如實心或中斷,或是單一或雙精度浮點數。

lineColor
UInt32

unsigned int

uint32_t

尺規線條的色彩,做為整數值,等於 ClaimedReceiptPrinter.ColorCartants 屬性中使用的批註常數值。 如果指定了不支援的值,列印結果可能會無法預測。

實作

M:Windows.Devices.PointOfService.IReceiptOrSlipJob.DrawRuledLine(System.String,Windows.Devices.PointOfService.PosPrinterLineDirection,System.UInt32,Windows.Devices.PointOfService.PosPrinterLineStyle,System.UInt32) M:Windows.Devices.PointOfService.IReceiptOrSlipJob.DrawRuledLine(Platform::String,Windows.Devices.PointOfService.PosPrinterLineDirection,unsigned int,Windows.Devices.PointOfService.PosPrinterLineStyle,unsigned int) M:Windows.Devices.PointOfService.IReceiptOrSlipJob.DrawRuledLine(winrt::hstring,Windows.Devices.PointOfService.PosPrinterLineDirection,uint32_t,Windows.Devices.PointOfService.PosPrinterLineStyle,uint32_t)

備註

positionList引數會根據要繪製水準或垂直尺規線條而有所不同。

對於水平尺規線, positionList 是由以逗號分隔的數位所組成, (度量單位是由 MapMode 屬性) 所定義,代表每一行的起始位置和長度。 如果指定多個尺規行,則每個配對後面都會加上分號。 此模式會針對所有其他水平尺規線重複。 請考慮此範例:

positionList = "0,500"

positionList 會導致從 MapMode 單位位置 「0」 開始的尺規線條,持續長度為 500 個 MapMode 單位。 以下是示範多個水平線的另一個範例:

positionList = "0,200;300,100"

positionList 會導致從單位位置 「0」 開始的尺規行,並持續長度為 200 單位。 然後,另一行會從位置 300 開始,並繼續長度為 100 單位。

若為垂直尺規線, positionList 是由 mapMode 屬性所定義 (以逗號分隔的數位,) 表示垂直繪製規則線 () 的位置。 在呼叫 DrawRuledLine 或規則行逸出序列之前,會從每一個列印線的位置繪製連續垂直尺規線。直到垂直規則線變更或終止為止。 positionLine引數中的空字串會導致垂直尺規行終止。 請考慮此範例:

positionList = "0,100,400,500"

positionList 會在列印每一行資料時,從單位位置 「0」、「100」、「400」 和 「500」 開始繪製的尺規線條產生四條繪製的尺規線。

適用於

另請參閱