android-Paint-getTextBounds参数详解

官网API:

getTextBounds

Added in  API level 1
void getTextBounds (String text, 
                int start, 
                int end, 
                Rect bounds)

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).由调用者返回在边界(分配)的最小矩形包含所有的字符,以隐含原点(0,0)。

Parameters
text String: String to measure and return its bounds 字符串来衡量并返回它的界限
start int: Index of the first char in the string to measure 索引的第一个字符的字符串来衡量
end int: 1 past the last char in the string measure 1过去的最后一个字符字符串
bounds Rect: Returns the unioned bounds of all the text. Must be allocated by the caller.返回联合边界的所有文本。必须分配给调用者。

getTextBounds

Added in  API level 1
void getTextBounds (char[] text, 
                int index, 
                int count, 
                Rect bounds)

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).由调用者返回在边界(分配)的最小矩形包含所有的字符,以隐含原点(0,0)。

Parameters
text char: Array of chars to measure and return their unioned bounds数组的字符来衡量并返回他们的联合
index int: Index of the first char in the array to measure第一个字符的索引数组来衡量
count int: The number of chars, beginning at index, to measure字符的数量,从指数来衡量
bounds Rect: Returns the unioned bounds of all the text. Must be allocated by the caller.返回联合边界的所有文本。必须分配给调用者。

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值