Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi I encounter a problem in C# winform program, How can I analyze whether a rectangle is overlap another rectangle
Posted

Collision detection is a very interesting field in computer graphics specially when you add a Response keyword to it (I mean Collision detection and response) :

For checking collision :
http://www.gamedev.net/topic/185212-rectangle-collision-detection-in-c/[^]

For having collision and response use this library :
http://farseerphysics.codeplex.com/[^]

Hope it helps.
 
Share this answer
 
Comments
dirk.zhang 17-Jan-12 21:58pm    
thank you
Amir Mahfoozi 17-Jan-12 23:50pm    
You're welcome.
You may use Rectangle.Intersect(Rectangle).
See http://msdn.microsoft.com/en-us/library/system.drawing.rectangle.intersect.aspx[^]

Cheers

Andi
 
Share this answer
 
Comments
Amir Mahfoozi 16-Jan-12 9:44am    
+5
Andreas Gieriet 16-Jan-12 10:02am    
Thank you, Amir. Andi
dirk.zhang 17-Jan-12 21:58pm    
thank you
Andreas Gieriet 18-Jan-12 9:33am    
You are welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900