DrawTextBox
文字, 頁面版面配置
描述
此函式類似 DrawText 函式,但文字放在指定的邊界框內。垂直對齊可用 Options 參數設定,水平對齊可用 SetTextAlign 函式設定。文字會自動斷詞換行以符合邊界框。
語法
Delphi
Function TPDFlib.DrawTextBox(Left, Top, Width, Height: Double; Const Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::DrawTextBox(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Options As Long) As Long
DLL
int DLDrawTextBox(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * Text, int Options);
參數
| Left | 邊界框左緣的水平座標 |
|---|---|
| Top | 邊界框上緣的垂直座標 |
| Width | 邊界框的寬度 |
| Height | 邊界框的高度 |
| Text | 要畫到頁面上的文字 |
| Options | 0 = 垂直置中對齊 1 = 垂直向上對齊 2 = 垂直向下對齊 3 = 垂直置中對齊,不自動換行 4 = 垂直向上對齊,不自動換行 5 = 垂直向下對齊,不自動換行 |
傳回值
| 0 | Options 參數超出範圍,或 Width 參數小到放不下任何文字 |
|---|---|
| Non-zero | 實際繪製的文字行數 |