跳至内容

TextGetSize

TextGetSize

此函数返回当前字体设置下的行宽和行高。

bool  TextGetSize(
   const string   text,    // text string
   uint&          width,   // buffer width in pixels
   uint&          height   // buffer height in pixels
   );

参数

text

[in] 字符串,需要获取其长度和宽度。

width

[out] 输入参数,用于接收宽度。

height

[out] 输入参数,用于接收高度。

返回值

如果成功则返回true,否则返回false。可能的代码错误:

  • ERR_INTERNAL_ERROR(4001) - 操作系统错误。

另请参阅

资源, ResourceCreate(), ResourceSave(), TextSetFont(), TextOut()

最后更新于