FitTextBoxA
文字, 頁面版面配置
描述
結尾的 A 表示 ANSI(char)DLL 進入點;ActiveX/COM 介面只提供 Unicode 形式。行為與 FitTextBox 完全相同,字串參數依目前 SetAnsiMode 的字碼頁解讀
類似 DrawText 函式,但會調整文字大小,確保所有文字都放得進可用空間
語法
Delphi
Function DLFitTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer;
DLL
int DLFitTextBoxA(int InstanceID, double Left, double Top, double Width, double Height, const char* Text, int Options);
參數
| Left | 邊界框左緣的水平座標 |
|---|---|
| Top | 邊界框上緣的垂直座標 |
| Width | 邊界框的寬度 |
| Height | 邊界框的高度 |
| Text | 要顯示在框內的文字 |
| Options | 垂直對齊:0 = 置中 1 = 靠上 2 = 靠下 這些值加 100 時,長單字不會被拆開,字型大小會縮小直到最長的單字放得進可用寬度。加 1000 時,字型大小可以放大直到文字填滿可用區域。 |
傳回值
| 0 | 指定的 Options 超出範圍 |
|---|---|
| 1 | 文字繪製成功 |