【问题标题】:Cover very coordinate of an image in an array [closed]覆盖数组中图像的非常坐标[关闭]
【发布时间】:2015-03-25 23:12:06
【问题描述】:

given 是图像的 x 和 y 坐标,以及它的高度和宽度。

我现在想将该图像的每个像素(仅位置)存储在一个数组中,因此我可以将它们与另一个也保存图像坐标的数组进行比较,以检查这些图像是否发生碰撞。我怎样才能做到这一点?我想到了一个数组,但即使我也阅读了很多关于数组的解释资料,我还是不明白。

【问题讨论】:

    标签: java arrays image coordinates


    【解决方案1】:

    我认为你真正需要的是 2 个图像所代表的 2 个矩形是否相交。

    要检查两个矩形是否相交,请参阅Math/ Algorithm/ JS: How to determine if 2+ rectangles intersect, given the TopLeft(x0, y0) and Bottom-Right(x1, y1) of each rectangle

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-23
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2019-12-05
      • 1970-01-01
      • 2015-12-19
      • 2016-12-10
      相关资源
      最近更新 更多