除了迭代像素之外,我也没有看到其他选项:
public Pixmap flipPixmap(Pixmap src) {
final int width = src.getWidth();
final int height = src.getHeight();
Pixmap flipped = new Pixmap(width, height, src.getFormat());
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
flipped.drawPixel(x, y, src.getPixel(width - x - 1, y));
}
}
return flipped;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2664 次 |
| 最近记录: |