locked
how to find biggest rectangle in a region RRS feed

  • Question

  • Hi all
     is there any way to find biggest regular rectangle inside a region?
    • Moved by jack 321 Friday, August 29, 2008 9:17 AM not a C# issue (Moved from Visual C# General to Off-Topic Posts (Do Not Post Here))
    Tuesday, August 26, 2008 7:10 PM

Answers

All replies

  • This is not a C# question.  Moreover, the question is deep depending on your definition of a "regular" rectangle and "region".
    • Marked as answer by jack 321 Friday, August 29, 2008 9:17 AM
    Wednesday, August 27, 2008 2:31 AM
  •  http://msdn.microsoft.com/en-us/library/system.drawing.region.getregiondata.aspx

    GetRegionData function will give you all shapes in the region, you can check height/width then to find biggest rectangle.

    Please mark this as answer if you feel like

    Thanks,
    Viral.
    • Marked as answer by jack 321 Friday, August 29, 2008 9:17 AM
    Wednesday, August 27, 2008 4:07 AM
  • thanks but i dont know how i interpret the data
    Wednesday, August 27, 2008 10:25 AM
  • I think you want to use GraphicsPath and not Region, which has PathPoints and PathTypes properties. Let me know if that sounds good!

    Thanks,
    Viral.
    Wednesday, August 27, 2008 10:53 AM
  • no i am not looking for pathpoints.
    thanks
    Wednesday, August 27, 2008 1:24 PM