FitTextBox
文字, 頁面版面配置
描述
類似 DrawText 函式,但會調整文字大小,確保所有文字都放得進可用空間
語法
Delphi
Function TPDFlib.FitTextBox(Left, Top, Width, Height: Double; Const Text: WideString; Options: Integer): Integer;
ActiveX
Function PDFlib::FitTextBox(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Options As Long) As Long
DLL
int DLFitTextBox(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 = 靠下 這些值加 100 時,長單字不會被拆開,字型大小會縮小直到最長的單字放得進可用寬度。加 1000 時,字型大小可以放大直到文字填滿可用區域。 |
傳回值
| 0 | 指定的 Options 超出範圍 |
|---|---|
| 1 | 文字繪製成功 |