android - Android图形在不同的api上绘制错误的视角
问题描述
制作应用程序时,我需要绘制一个透视图。在 api> 27 上一切都很好,但在 27 及以下奇怪的事情!底部两点错误的构建视角
float[] srcT = {
0, 0, // Coordinate of top left point
0, height, // Coordinate of bottom left point
wight, height, // Coordinate of bottom right point
wight, 0 // Coordinate of top right point
};
float[] dstT = {
top_left_x, top_left_y, // Coordinate of top left point
bottom_left_x, bottom_left_y, // Coordinate of bottom left point
bottom_right_x, bottom_right_y, // Coordinate of bottom right point
top_right_x, top_right_y // Coordinate of top right point
};
Shader shader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
matrix.setPolyToPoly(srcT, 0, dstT, 0, 4);
shader.setLocalMatrix(matrix);
paint.setShader(shader);
它在 28 api 上:
这是 22 api:
解决方案
推荐阅读
- android - android studio配置文件没有调试应用程序(ram测试)
- java - Eclipse 项目的 PlantUML 图
- java - 有没有办法在方法参数中将 Java 代码片段作为 Groovy Closure 传递?
- javascript - PageObjects:如何在另一个函数中调用一个函数?
- python - itertools.product 如何在不将中间结果保存在内存中的情况下计算笛卡尔积
- r - 有条件的 tidyr::complete() 到变量最大值
- c# - 如何在 C# 中计算文本文件中的字符串
- javascript - 取决于媒体查询的通用参数
- php - 从控制器到视图的空数组 - Laravel
- kubernetes - 在实时和未来节点上配置 kubelet