【发布时间】:2012-11-03 15:01:45
【问题描述】:
我有以下代码 sn-p,它使用画布的当前转换矩阵转换一组边界。
final RectF bounds = renderer.computeBounds
activeCanvas.getMatrix().mapRect(result, bounds);
return bounds;
但是,对于最新的 API 级别 (16),我会收到一条警告说明
The method getMatrix() from the type Canvas is deprecated
由API 16 Diff Specification 确认。
这很好,但是Canvas.getMatrix() 上的当前文档没有提到弃用,也没有提供替代方案。作为一种解决方法,我现在只是取消了这个警告,但我真的很想知道新的和改进的 (tm) 方法是什么样的。
【问题讨论】:
-
使用 canvas.concat(matrix)
标签: android android-4.2-jelly-bean