Check if a point is in a rotated rectangle (C#)

前端 未结 7 1460
囚心锁ツ
囚心锁ツ 2021-01-07 22:20

I have a program in C# (Windows Forms) which draws some rectangles on a picturebox. They can be drawn at an angle too (rotated).

I know each of the rectangles\' star

相关标签:
7条回答
  • 2021-01-07 22:55

    You could keep a second, undisplayed image where you draw duplicates of the rectangles, each uniquely colored. When the user clicks on the picturebox, find the color of the corresponding pixel in the 2nd image, which will identify which rectangle was clicked.

    0 讨论(0)
提交回复
热议问题