Reputation: 1896
We are using GDI+ and we have different regions or graphicspath. How to determine if a rectangle is completely inside this region.
Upvotes: 2
Views: 1185
Reputation: 59466
The following function returns whether or not the union of region r
and rectangle r1
is equal to r
. Theoretically it is the same as determining whether r
completely contains r1
. Also, it requires a Graphics
object to perform the comparison.
bool Contains(Region r, RectangleF r1, Graphics g) {
Region u = r.Clone();
u.Union(r1);
return r.Equals(u, g);
}
Update: Corrected region comparison as discussed in another post
Upvotes: 2
Reputation: 11
I Guess,
Upvotes: 1