随笔 - 2146  文章 - 19 评论 - 11846 阅读 - 1267万

随笔分类 -  API 文本与字体函数

WinAPI: CreateFontIndirect - 根据字体结构建立逻辑字体
摘要://声明: CreateFontIndirect( const p1: TLogFont {字体结构} ): HFONT; {返回新字体指针} //TLogFont 是 tagLOGFONTA 结构的重定义: tagLOGFONTA = packed record lfHeight: Longint; {字体高度} lfWidth: Longint;... 阅读全文
posted @ 2008-02-09 15:08 万一 阅读(11987) 评论(5) 推荐(3) 编辑
WinAPI: GetCharABCWidths - 获取 TrueType 字符的宽度信息
摘要://声明: GetCharABCWidths( DC: HDC; {设备环境句柄} FirstChar, LastChar: UINT; {范围内的第一个和最后一个字符值} const ABCStructs {接受每个字符信息的 TABC 结构数组} ): BOOL; //TABC 类型是 _ABC 结构的重定义: _ABC ... 阅读全文
posted @ 2008-02-09 12:42 万一 阅读(4181) 评论(0) 推荐(0) 编辑
WinAPI: GetCharWidth 和 GetCharWidth32 - 获取字符宽度
摘要://声明: GetCharWidth( DC: HDC; {设备环境句柄} FirstChar, LastChar: UINT; {范围内的第一个和最后一个字符值} const Widths {接受每个字符宽度值的整型数组} ): BOOL; GetCharWidth32( DC: HDC; ... 阅读全文
posted @ 2008-02-09 11:55 万一 阅读(6477) 评论(2) 推荐(1) 编辑
WinAPI: GetTextFace - 获取字体名称
摘要://声明: GetTextFace( DC: HDC; {设备环境句柄} Count: Integer; {缓冲区大小} Buffer: PChar {缓冲区} ): Integer; {返回字符串长度} //举例: var dc: HDC; b: array[0..254] of Char; num: Integer; begin ... 阅读全文
posted @ 2008-02-09 11:20 万一 阅读(3264) 评论(0) 推荐(0) 编辑
WinAPI: SetTextJustification - 设置两端对齐
摘要://声明: SetTextJustification( DC: HDC; {设备环境句柄} BreakExtra, {宽度} BreakCount: Integer {被分成几份; 一般以空格为间隔} ): Integer; {成功返回非 0 值; 失败返回 0} //举例: procedure TForm1.FormPa... 阅读全文
posted @ 2008-02-08 21:17 万一 阅读(3359) 评论(3) 推荐(0) 编辑
WinAPI: SetTextCharacterExtra - 设置字符间距
摘要://声明: SetTextCharacterExtra( DC: HDC; {设备环境句柄} CharExtra: Integer {间距(按逻辑单位); 若映射模式不是 MM_TEXT, 则舍入到最接近的像素} ): Integer; {返回字符间隔的先前值; 调用失败返回 $80000000 } //举例: procedure TForm1.... 阅读全文
posted @ 2008-02-08 20:54 万一 阅读(6531) 评论(3) 推荐(0) 编辑
WinAPI: GetTextAlign - 获取绘图环境的文本对齐方式
摘要://声明: GetTextAlign( DC: HDC; {设备环境句柄} ): UINT; {返回对齐选项值; 如果返回 GDI_ERROR 表示设置失败} //如果调用成功则返回下面常数值之一或它们的组合: TA_NOUPDATECP = 0; {每一次文本输出后, 不更新当前位置} TA_UPDATECP = 1; {每一次文本输出后, 更新当前位置}... 阅读全文
posted @ 2008-02-08 19:54 万一 阅读(2247) 评论(0) 推荐(0) 编辑
WinAPI: SetTextAlign - 设置绘图环境的文本对齐方式
摘要://声明: SetTextAlign( DC: HDC; {设备环境句柄} Flags: UINT {对齐选项} ): UINT; {返回对齐选项值; 如果返回 GDI_ERROR 表示设置失败} //Flags 参数的可选值: TA_NOUPDATECP = 0; {每一次文本输出后, 不更新当前位置} TA_UPDATECP = 1; {每一次文本输... 阅读全文
posted @ 2008-02-08 19:49 万一 阅读(5714) 评论(0) 推荐(0) 编辑
WinAPI: ExtTextOut - 扩展的文本输出
摘要://声明: ExtTextOut( DC: HDC; {设备环境句柄} X, Y: Integer; {起点坐标} Options: Longint; {选项} Rect: PRect; {指定显示范围; 0 表示限制范围} Str: PChar; {字符串指针} Count: Longint; {字符串长度} Dx:... 阅读全文
posted @ 2008-02-08 16:50 万一 阅读(10567) 评论(5) 推荐(0) 编辑
WinAPI: TextOut - 输出文本
摘要://声明: TextOut( DC: HDC; {设备环境句柄} X, Y: Integer; {起点坐标} Str: PChar; {字符串指针} Count: Integer {字符串长度} ): BOOL; //举例: procedure TForm1.FormPaint(Sender: TObject); const str = '万一的 Del... 阅读全文
posted @ 2008-02-08 15:54 万一 阅读(6219) 评论(8) 推荐(1) 编辑
WinAPI: SetTextColor - 设置设备环境的文本颜色
摘要://声明: SetTextColor( DC: HDC; {设备环境句柄} Color: COLORREF {颜色值} ): COLORREF; {返回指定的颜色值; 如果返回值是 CLR_INVALID 表示设置失败} //举例: procedure TForm1.Button1Click(Sender: TObject); begin SetTextC... 阅读全文
posted @ 2008-02-08 15:19 万一 阅读(3400) 评论(6) 推荐(0) 编辑
WinAPI: GetTextColor - 获取设备环境的文本颜色
摘要://声明: GetTextColor( DC: HDC {设备环境句柄} ): COLORREF; {返回一个 Cardinal 类型的颜色值} //举例: var c: Cardinal; begin c := GetTextColor(Canvas.Handle); ShowMessage(IntToStr(c)); end; 阅读全文
posted @ 2008-02-08 15:09 万一 阅读(2247) 评论(0) 推荐(0) 编辑
WinAPI: DrawTextEx - 多功能文本绘制
摘要://声明: DrawTextEx( DC: HDC; {设备句柄} lpchText: PChar; {文本} cchText: Integer; {要绘制的字符个数; -1 表示全部} var p4: TRect; {矩形结构} dwDTFormat: UINT; {选... 阅读全文
posted @ 2008-02-08 14:03 万一 阅读(9004) 评论(0) 推荐(0) 编辑
WinAPI: DrawText - 将文本绘制到指定的矩形中
摘要://声明: DrawText( hDC: HDC; {设备句柄} lpString: PChar; {文本} nCount: Integer; {要绘制的字符个数; -1 表示全部} var lpRect: TRect; {矩形结构} uFormat: UINT {选项} ): Integer; {返回文本高度} //u... 阅读全文
posted @ 2008-02-08 12:36 万一 阅读(7490) 评论(5) 推荐(0) 编辑



点击右上角即可分享
微信分享提示